llvm.org GIT mirror llvm / 7bf4bc5
convert to filecheck syntax and make a lot more aggressive. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84517 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 10 years ago
1 changed file(s) with 68 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
None ; RUN: llc < %s -mtriple=arm-apple-darwin -relocation-model=static | \
1 ; RUN: not grep {L_G\$non_lazy_ptr}
2 ; RUN: llc < %s -mtriple=arm-apple-darwin -relocation-model=dynamic-no-pic | \
3 ; RUN: grep {L_G\$non_lazy_ptr} | count 2
4 ; RUN: llc < %s -mtriple=arm-apple-darwin -relocation-model=pic | \
5 ; RUN: grep {ldr.*pc} | count 1
6 ; RUN: llc < %s -mtriple=arm-linux-gnueabi -relocation-model=pic | \
7 ; RUN: grep {GOT} | count 1
0 ; RUN: llc < %s -mtriple=arm-apple-darwin -relocation-model=static | FileCheck %s -check-prefix=DarwinStatic
1 ; RUN: llc < %s -mtriple=arm-apple-darwin -relocation-model=dynamic-no-pic | FileCheck %s -check-prefix=DarwinDynamic
2 ; RUN: llc < %s -mtriple=arm-apple-darwin -relocation-model=pic | FileCheck %s -check-prefix=DarwinPIC
3 ; RUN: llc < %s -mtriple=arm-linux-gnueabi -relocation-model=pic | FileCheck %s -check-prefix=LinuxPIC
84
95 @G = external global i32
106
128 %tmp = load i32* @G
139 ret i32 %tmp
1410 }
11
12 ; DarwinStatic: _test1:
13 ; DarwinStatic: ldr r0, LCPI1_0
14 ; DarwinStatic: ldr r0, [r0]
15 ; DarwinStatic: bx lr
16
17 ; DarwinStatic: .align 2
18 ; DarwinStatic: LCPI1_0:
19 ; DarwinStatic: .long {{_G$}}
20
21
22 ; DarwinDynamic: _test1:
23 ; DarwinDynamic: ldr r0, LCPI1_0
24 ; DarwinDynamic: ldr r0, [r0]
25 ; DarwinDynamic: ldr r0, [r0]
26 ; DarwinDynamic: bx lr
27
28 ; DarwinDynamic: .align 2
29 ; DarwinDynamic: LCPI1_0:
30 ; DarwinDynamic: .long L_G$non_lazy_ptr
31
32 ; DarwinDynamic: .section __DATA,__nl_symbol_ptr,non_lazy_symbol_pointers
33 ; DarwinDynamic: .align 2
34 ; DarwinDynamic: L_G$non_lazy_ptr:
35 ; DarwinDynamic: .indirect_symbol _G
36 ; DarwinDynamic: .long 0
37
38
39
40 ; DarwinPIC: _test1:
41 ; DarwinPIC: ldr r0, LCPI1_0
42 ; DarwinPIC: LPC0:
43 ; DarwinPIC: ldr r0, [pc, +r0]
44 ; DarwinPIC: ldr r0, [r0]
45 ; DarwinPIC: bx lr
46
47 ; DarwinPIC: .align 2
48 ; DarwinPIC: LCPI1_0:
49 ; DarwinPIC: .long L_G$non_lazy_ptr-(LPC0+8)
50
51 ; DarwinPIC: .section __DATA,__nl_symbol_ptr,non_lazy_symbol_pointers
52 ; DarwinPIC: .align 2
53 ; DarwinPIC: L_G$non_lazy_ptr:
54 ; DarwinPIC: .indirect_symbol _G
55 ; DarwinPIC: .long 0
56
57
58
59 ; LinuxPIC: test1:
60 ; LinuxPIC: ldr r0, .LCPI1_0
61 ; LinuxPIC: ldr r1, .LCPI1_1
62
63 ; LinuxPIC: .LPC0:
64 ; LinuxPIC: add r0, pc, r0
65 ; LinuxPIC: ldr r0, [r1, +r0]
66 ; LinuxPIC: ldr r0, [r0]
67 ; LinuxPIC: bx lr
68
69 ; LinuxPIC: .align 2
70 ; LinuxPIC: .LCPI1_0:
71 ; LinuxPIC: .long _GLOBAL_OFFSET_TABLE_-(.LPC0+8)
72 ; LinuxPIC: .align 2
73 ; LinuxPIC: .LCPI1_1:
74 ; LinuxPIC: .long G(GOT)