1 ; RUN: llc < %s -mtriple=armv6-apple-darwin -relocation-model=static | FileCheck %s -check-prefix=DarwinStatic
2 ; RUN: llc < %s -mtriple=armv6-apple-darwin -relocation-model=dynamic-no-pic | FileCheck %s -check-prefix=DarwinDynamic
3 ; RUN: llc < %s -mtriple=armv6-apple-darwin -relocation-model=pic | FileCheck %s -check-prefix=DarwinPIC
4 ; RUN: llc < %s -mtriple=armv6-linux-gnueabi -relocation-model=pic | FileCheck %s -check-prefix=LinuxPIC
6 @G = external global i32
9 %tmp = load i32, i32* @G
13 ; DarwinStatic: _test1:
14 ; DarwinStatic: ldr r0, LCPI0_0
15 ; DarwinStatic: ldr r0, [r0]
18 ; DarwinStatic: .p2align 2
19 ; DarwinStatic: LCPI0_0:
20 ; DarwinStatic: .long {{_G$}}
23 ; DarwinDynamic: _test1:
24 ; DarwinDynamic: ldr r0, LCPI0_0
25 ; DarwinDynamic: ldr r0, [r0]
26 ; DarwinDynamic: ldr r0, [r0]
27 ; DarwinDynamic: bx lr
29 ; DarwinDynamic: .p2align 2
30 ; DarwinDynamic: LCPI0_0:
31 ; DarwinDynamic: .long L_G$non_lazy_ptr
33 ; DarwinDynamic: .section __DATA,__nl_symbol_ptr,non_lazy_symbol_pointers
34 ; DarwinDynamic: .p2align 2
35 ; DarwinDynamic: L_G$non_lazy_ptr:
36 ; DarwinDynamic: .indirect_symbol _G
37 ; DarwinDynamic: .long 0
42 ; DarwinPIC: ldr r0, LCPI0_0
44 ; DarwinPIC: ldr r0, [pc, r0]
45 ; DarwinPIC: ldr r0, [r0]
49 ; DarwinPIC: .p2align 2
51 ; DarwinPIC: .long L_G$non_lazy_ptr-(LPC0_0+8)
53 ; DarwinPIC: .section __DATA,__nl_symbol_ptr,non_lazy_symbol_pointers
54 ; DarwinPIC: .p2align 2
55 ; DarwinPIC: L_G$non_lazy_ptr:
56 ; DarwinPIC: .indirect_symbol _G
61 ; LinuxPIC-LABEL: test1:
62 ; LinuxPIC: ldr r0, .LCPI0_0
65 ; LinuxPIC: ldr r0, [pc, r0]
66 ; LinuxPIC: ldr r0, [r0]
69 ; LinuxPIC: .p2align 2
72 ; LinuxPIC: .long G(GOT_PREL)-((.LPC0_0+8)-.Ltmp0)