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
8 @G = external global i32
12 ; STATIC: ldr r0, LCPI0_0
13 ; STATIC: ldr r0, [r0]
17 ; DYNAMIC: ldr r0, LCPI0_0
18 ; DYNAMIC: ldr r0, [r0]
19 ; DYNAMIC: ldr r0, [r0]
20 ; DYNAMIC: .long L_G$non_lazy_ptr
23 ; PIC: ldr r0, LCPI0_0
24 ; PIC: ldr r0, [pc, r0]
26 ; PIC: .long L_G$non_lazy_ptr-(LPC0_0+8)
29 ; PIC_T: ldr.n r0, LCPI0_0
33 ; PIC_T: .long L_G$non_lazy_ptr-(LPC0_0+4)
36 ; PIC_V7: movw r0, :lower16:(L_G$non_lazy_ptr-(LPC0_0+8))
37 ; PIC_V7: movt r0, :upper16:(L_G$non_lazy_ptr-(LPC0_0+8))
38 ; PIC_V7: ldr r0, [pc, r0]
39 ; PIC_V7: ldr r0, [r0]
42 ; LINUX: ldr r0, .LCPI0_0
43 ; LINUX: ldr r1, .LCPI0_1
44 ; LINUX: add r0, pc, r0
45 ; LINUX: ldr r0, [r1, r0]