1 ; RUN: llvm-as < %s | llc -relocation-model=static | FileCheck %s -check-prefix=STATIC
2 ; RUN: llvm-as < %s | llc -relocation-model=pic | FileCheck %s -check-prefix=PIC
3 ; RUN: llvm-as < %s | llc -relocation-model=dynamic-no-pic | FileCheck %s -check-prefix=DYNAMIC
5 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"
6 target triple = "armv6-apple-darwin2"
8 define i32 @foo(i64 %x) nounwind {
11 ; STATIC: bl _exact_log2
12 ; STATIC: ldmfd sp!, {r7, pc}
13 ; STATIC: .subsections_via_symbols
16 ; PIC: bl L_exact_log2$stub
17 ; PIC: ldmfd sp!, {r7, pc}
20 ; DYNAMIC: bl L_exact_log2$stub
21 ; DYNAMIC: ldmfd sp!, {r7, pc}
23 %A = call i32 @exact_log2(i64 %x)
27 define available_externally i32 @exact_log2(i64 %x) nounwind {
32 ; PIC: .section __TEXT,__picsymbolstub4,symbol_stubs,none,16
33 ; PIC: L_exact_log2$stub:
34 ; PIC: .indirect_symbol _exact_log2
35 ; PIC: ldr ip, L_exact_log2$slp
36 ; PIC: L_exact_log2$scv:
38 ; PIC: ldr pc, [ip, #0]
39 ; PIC: L_exact_log2$slp:
40 ; PIC: .long L_exact_log2$lazy_ptr-(L_exact_log2$scv+8)
42 ; PIC: .section __DATA,__la_symbol_ptr,lazy_symbol_pointers
43 ; PIC: L_exact_log2$lazy_ptr:
44 ; PIC: .indirect_symbol _exact_log2
45 ; PIC: .long dyld_stub_binding_helper
47 ; PIC: .subsections_via_symbols
50 ; DYNAMIC: .section __TEXT,__symbol_stub4,symbol_stubs,none,12
51 ; DYNAMIC: L_exact_log2$stub:
52 ; DYNAMIC: .indirect_symbol _exact_log2
53 ; DYNAMIC: ldr ip, L_exact_log2$slp
54 ; DYNAMIC: ldr pc, [ip, #0]
55 ; DYNAMIC: L_exact_log2$slp:
56 ; DYNAMIC: .long L_exact_log2$lazy_ptr
58 ; DYNAMIC: .section __DATA,__la_symbol_ptr,lazy_symbol_pointers
59 ; DYNAMIC: L_exact_log2$lazy_ptr:
60 ; DYNAMIC: .indirect_symbol _exact_log2
61 ; DYNAMIC: .long dyld_stub_binding_helper
62 ; DYNAMIC: .subsections_via_symbols