diff options
author | Chris Lattner <sabre@nondot.org> | 2009-07-15 01:43:31 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-07-15 01:43:31 +0000 |
commit | a9aa3523bfbf048c33eb52d44dd0449a10cc9c26 (patch) | |
tree | 63f2b394cfa4e667e6607b379036ed2c7a7d3bca | |
parent | 0bc26723c56acc95f347f4e39bdf929e78cad708 (diff) | |
download | external_llvm-a9aa3523bfbf048c33eb52d44dd0449a10cc9c26.zip external_llvm-a9aa3523bfbf048c33eb52d44dd0449a10cc9c26.tar.gz external_llvm-a9aa3523bfbf048c33eb52d44dd0449a10cc9c26.tar.bz2 |
convert this to filecheck style and make it a test of darwin/PPC's
extremely elaborate pic/nopic stubs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75726 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | test/CodeGen/PowerPC/available-externally.ll | 58 |
1 files changed, 57 insertions, 1 deletions
diff --git a/test/CodeGen/PowerPC/available-externally.ll b/test/CodeGen/PowerPC/available-externally.ll index c7e172c..111a15f 100644 --- a/test/CodeGen/PowerPC/available-externally.ll +++ b/test/CodeGen/PowerPC/available-externally.ll @@ -1,10 +1,25 @@ -; RUN: llvm-as < %s | llc | grep {bl L_exact_log2.stub} +; RUN: llvm-as < %s | llc -relocation-model=static | FileCheck %s -check-prefix=STATIC +; RUN: llvm-as < %s | llc -relocation-model=pic | FileCheck %s -check-prefix=PIC +; RUN: llvm-as < %s | llc -relocation-model=dynamic-no-pic | FileCheck %s -check-prefix=DYNAMIC ; PR4482 target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128" target triple = "powerpc-apple-darwin8" define i32 @foo(i64 %x) nounwind { entry: +; STATIC: _foo: +; STATIC: bl _exact_log2 +; STATIC: blr +; STATIC: .subsections_via_symbols + +; PIC: _foo: +; PIC: bl L_exact_log2$stub +; PIC: blr + +; DYNAMIC: _foo: +; DYNAMIC: bl L_exact_log2$stub +; DYNAMIC: blr + %A = call i32 @exact_log2(i64 %x) nounwind ret i32 %A } @@ -13,3 +28,44 @@ define available_externally i32 @exact_log2(i64 %x) nounwind { entry: ret i32 42 } + + +; PIC: .section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32 +; PIC: L_exact_log2$stub: +; PIC: .indirect_symbol _exact_log2 +; PIC: mflr r0 +; PIC: bcl 20,31,L0$_exact_log2 + +; PIC: L0$_exact_log2: +; PIC: mflr r11 +; PIC: addis r11,r11,ha16(L_exact_log2$lazy_ptr-L0$_exact_log2) +; PIC: mtlr r0 +; PIC: lwzu r12,lo16(L_exact_log2$lazy_ptr-L0$_exact_log2)(r11) +; PIC: mtctr r12 +; PIC: bctr + +; PIC: .lazy_symbol_pointer +; PIC: L_exact_log2$lazy_ptr: +; PIC: .indirect_symbol _exact_log2 +; PIC: .long dyld_stub_binding_helper + +; PIC: .subsections_via_symbols + + +; DYNAMIC: .section __TEXT,__symbol_stub1,symbol_stubs,pure_instructions,16 +; DYNAMIC: L_exact_log2$stub: +; DYNAMIC: .indirect_symbol _exact_log2 +; DYNAMIC: lis r11,ha16(L_exact_log2$lazy_ptr) +; DYNAMIC: lwzu r12,lo16(L_exact_log2$lazy_ptr)(r11) +; DYNAMIC: mtctr r12 +; DYNAMIC: bctr + +; DYNAMIC: .lazy_symbol_pointer +; DYNAMIC: L_exact_log2$lazy_ptr: +; DYNAMIC: .indirect_symbol _exact_log2 +; DYNAMIC: .long dyld_stub_binding_helper + + + + + |