From 69e584bbd4720323ad07d324bce7f11e85675252 Mon Sep 17 00:00:00 2001 From: "Andrew V. Tischenko" Date: Thu, 2 Mar 2017 13:47:03 +0000 Subject: [PATCH] Added special test covering a problem with PIC relocation model on SLM architecture. The fix will come in D26855. llvm-svn: 296746 --- test/CodeGen/X86/recip-pic.ll | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 test/CodeGen/X86/recip-pic.ll diff --git a/test/CodeGen/X86/recip-pic.ll b/test/CodeGen/X86/recip-pic.ll new file mode 100644 index 00000000000..7a0d03d6072 --- /dev/null +++ b/test/CodeGen/X86/recip-pic.ll @@ -0,0 +1,27 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py +; RUN: llc < %s -mtriple=i386-unknown-linux-gnu -enable-unsafe-fp-math -mcpu=slm -relocation-model=pic | FileCheck %s --check-prefix=CHECK + +define fastcc float @foo(float %x) unnamed_addr #0 { +; CHECK-LABEL: foo: +; CHECK: # BB#0: # %entry +; CHECK-NEXT: calll .L0$pb +; CHECK-NEXT: .Lcfi0: +; CHECK-NEXT: .cfi_adjust_cfa_offset 4 +; CHECK-NEXT: .L0$pb: +; CHECK-NEXT: popl %eax +; CHECK-NEXT: .Lcfi1: +; CHECK-NEXT: .cfi_adjust_cfa_offset -4 +; CHECK-NEXT: .Ltmp0: +; CHECK-NEXT: addl $_GLOBAL_OFFSET_TABLE_+(.Ltmp0-.L0$pb), %eax +; CHECK-NEXT: movss {{.*#+}} xmm1 = mem[0],zero,zero,zero +; CHECK-NEXT: divss %xmm0, %xmm1 +; CHECK-NEXT: movaps %xmm1, %xmm0 +; CHECK-NEXT: movss %xmm1, (%eax) +; CHECK-NEXT: retl +entry: + %div = fdiv fast float 3.0, %x + store float %div, float* undef, align 4 + ret float %div +} + +