4aad567fa8f129eaf4651fb9c53ba1e3c0c6edb4
[oota-llvm.git] / test / CodeGen / Thumb2 / load-global.ll
1 ; RUN: llvm-as < %s | \
2 ; RUN:   llc -mtriple=thumbv7-apple-darwin -relocation-model=static | FileCheck %s -check-prefix=STATIC
3 ; RUN: llvm-as < %s | \
4 ; RUN:   llc -mtriple=thumbv7-apple-darwin -relocation-model=dynamic-no-pic | FileCheck %s -check-prefix=DYNAMIC
5 ; RUN: llvm-as < %s | \
6 ; RUN:   llc -mtriple=thumbv7-apple-darwin -relocation-model=pic | FileCheck %s -check-prefix=PIC
7 ; RUN: llvm-as < %s | \
8 ; RUN:   llc -mtriple=thumbv7-linux-gnueabi -relocation-model=pic | FileCheck %s -check-prefix=LINUX
9
10 @G = external global i32
11
12 define i32 @test1() {
13 ; STATIC: _test1:
14 ; STATIC: .long _G
15
16 ; DYNAMIC: _test1:
17 ; DYNAMIC: .long L_G$non_lazy_ptr
18
19 ; PIC: _test1
20 ; PIC: add r0, pc
21 ; PIC: .long L_G$non_lazy_ptr-(LPC0+4)
22
23 ; LINUX: test1
24 ; LINUX: .long G(GOT)
25         %tmp = load i32* @G
26         ret i32 %tmp
27 }