1
; RUN: llc < %s -relocation-model=static | FileCheck %s -check-prefix=STATIC
2
; RUN: llc < %s -relocation-model=pic | FileCheck %s -check-prefix=PIC
3
; RUN: llc < %s -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 = "powerpc-apple-darwin8"
8
define i32 @foo(i64 %x) nounwind {
11
; STATIC: bl _exact_log2
13
; STATIC: .subsections_via_symbols
16
; PIC: bl L_exact_log2$stub
20
; DYNAMIC: bl L_exact_log2$stub
23
%A = call i32 @exact_log2(i64 %x) nounwind
27
define available_externally i32 @exact_log2(i64 %x) nounwind {
33
; PIC: .section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32
34
; PIC: L_exact_log2$stub:
35
; PIC: .indirect_symbol _exact_log2
37
; PIC: bcl 20,31,L_exact_log2$stub$tmp
39
; PIC: L_exact_log2$stub$tmp:
41
; PIC: addis r11,r11,ha16(L_exact_log2$lazy_ptr-L_exact_log2$stub$tmp)
43
; PIC: lwzu r12,lo16(L_exact_log2$lazy_ptr-L_exact_log2$stub$tmp)(r11)
47
; PIC: .section __DATA,__la_symbol_ptr,lazy_symbol_pointers
48
; PIC: L_exact_log2$lazy_ptr:
49
; PIC: .indirect_symbol _exact_log2
50
; PIC: .long dyld_stub_binding_helper
52
; PIC: .subsections_via_symbols
55
; DYNAMIC: .section __TEXT,__symbol_stub1,symbol_stubs,pure_instructions,16
56
; DYNAMIC: L_exact_log2$stub:
57
; DYNAMIC: .indirect_symbol _exact_log2
58
; DYNAMIC: lis r11,ha16(L_exact_log2$lazy_ptr)
59
; DYNAMIC: lwzu r12,lo16(L_exact_log2$lazy_ptr)(r11)
63
; DYNAMIC: .section __DATA,__la_symbol_ptr,lazy_symbol_pointers
64
; DYNAMIC: L_exact_log2$lazy_ptr:
65
; DYNAMIC: .indirect_symbol _exact_log2
66
; DYNAMIC: .long dyld_stub_binding_helper