1 ; RUN: llc < %s -mtriple=armv6-apple-darwin -relocation-model=static | FileCheck %s -check-prefix=STATIC
2 ; RUN: llc < %s -mtriple=armv6-apple-darwin -relocation-model=dynamic-no-pic | FileCheck %s -check-prefix=DYNAMIC
3 ; RUN: llc < %s -mtriple=armv6-apple-darwin -relocation-model=pic | FileCheck %s -check-prefix=PIC
4 ; RUN: llc < %s -mtriple=thumbv6-apple-darwin -relocation-model=pic | FileCheck %s -check-prefix=PIC_T
5 ; RUN: llc < %s -mtriple=armv7-apple-darwin -relocation-model=pic | FileCheck %s -check-prefix=PIC_V7
6 ; RUN: llc < %s -mtriple=armv6-linux-gnueabi -relocation-model=pic | FileCheck %s -check-prefix=LINUX
7 ; RUN: llc < %s -mtriple=thumbv6-linux-gnueabi -relocation-model=pic | FileCheck %s -check-prefix=LINUX_T
9 @G = external global i32
13 ; STATIC: ldr r0, LCPI0_0
14 ; STATIC: ldr r0, [r0]
18 ; DYNAMIC: ldr r0, LCPI0_0
19 ; DYNAMIC: ldr r0, [r0]
20 ; DYNAMIC: ldr r0, [r0]
21 ; DYNAMIC: .long L_G$non_lazy_ptr
24 ; PIC: ldr r0, LCPI0_0
25 ; PIC: ldr r0, [pc, r0]
27 ; PIC: .long L_G$non_lazy_ptr-(LPC0_0+8)
30 ; PIC_T: ldr r0, LCPI0_0
34 ; PIC_T: .long L_G$non_lazy_ptr-(LPC0_0+4)
37 ; PIC_V7: movw r0, :lower16:(L_G$non_lazy_ptr-(LPC0_0+8))
38 ; PIC_V7: movt r0, :upper16:(L_G$non_lazy_ptr-(LPC0_0+8))
39 ; PIC_V7: ldr r0, [pc, r0]
40 ; PIC_V7: ldr r0, [r0]
43 ; LINUX: ldr r0, .LCPI0_0
44 ; LINUX: ldr r0, [pc, r0]
46 ; LINUX: .long G(GOT_PREL)-((.LPC0_0+8)-.Ltmp0)
48 ; LINUX_T: ldr r0, .LCPI0_0
50 ; LINUX_T: ldr r0, [r0]
51 ; LINUX_T: ldr r0, [r0]
52 %tmp = load i32, i32* @G