1 @ This test has a partner (ldr-pseudo-darwin.s) that contains matching
2 @ tests for the ldr-pseudo on darwin targets. We need separate files
3 @ because the syntax for switching sections and temporary labels differs
4 @ between darwin and linux. Any tests added here should have a matching
7 @RUN: llvm-mc -triple armv7-unknown-linux-gnueabi %s | FileCheck %s
8 @RUN: llvm-mc -triple thumbv5-unknown-linux-gnueabi %s | FileCheck %s
9 @RUN: llvm-mc -triple thumbv7-unknown-linux-gnueabi %s | FileCheck %s
12 @ Check that large constants are converted to ldr from constant pool
15 .section b,"ax",%progbits
19 @ CHECK: ldr r0, .Ltmp[[TMP0:[0-9]+]]
21 @ loading multiple constants
22 .section c,"ax",%progbits
26 @ CHECK: ldr r0, .Ltmp[[TMP1:[0-9]+]]
32 @ CHECK: ldr r0, .Ltmp[[TMP2:[0-9]+]]
36 @ TODO: the same constants should have the same constant pool location
37 .section d,"ax",%progbits
41 @ CHECK: ldr r0, .Ltmp[[TMP3:[0-9]+]]
50 @ CHECK: ldr r0, .Ltmp[[TMP4:[0-9]+]]
58 @ a section defined in multiple pieces should be merged and use a single constant pool
59 .section e,"ax",%progbits
63 @ CHECK: ldr r0, .Ltmp[[TMP5:[0-9]+]]
68 .section f, "ax", %progbits
75 .section e, "ax", %progbits
80 @ CHECK: ldr r0, .Ltmp[[TMP6:[0-9]+]]
85 @ Check that symbols can be loaded using ldr pseudo
88 @ load an undefined symbol
89 .section g,"ax",%progbits
93 @ CHECK: ldr r0, .Ltmp[[TMP7:[0-9]+]]
95 @ load a symbol from another section
96 .section h,"ax",%progbits
100 @ CHECK: ldr r0, .Ltmp[[TMP8:[0-9]+]]
102 @ load a symbol from the same section
103 .section i,"ax",%progbits
107 @ CHECK: ldr r0, .Ltmp[[TMP9:[0-9]+]]
114 .section j,"ax",%progbits
115 @ mix of symbols and constants
121 @ CHECK: ldr r0, .Ltmp[[TMP10:[0-9]+]]
125 @ CHECK: ldr r0, .Ltmp[[TMP11:[0-9]+]]
129 @ Check for correct usage in other contexts
133 .macro useit_in_a_macro
137 .section k,"ax",%progbits
141 @ CHECK: ldr r0, .Ltmp[[TMP12:[0-9]+]]
142 @ CHECK: ldr r0, .Ltmp[[TMP13:[0-9]+]]
144 @ usage with expressions
145 .section l, "ax", %progbits
149 @ CHECK: ldr r0, .Ltmp[[TMP14:[0-9]+]]
152 @ CHECK: ldr r0, .Ltmp[[TMP15:[0-9]+]]
158 @ CHECK: .section b,"ax",%progbits
160 @ CHECK: .Ltmp[[TMP0]]
163 @ CHECK: .section c,"ax",%progbits
165 @ CHECK: .Ltmp[[TMP1]]
167 @ CHECK: .Ltmp[[TMP2]]
170 @ CHECK: .section d,"ax",%progbits
172 @ CHECK: .Ltmp[[TMP3]]
174 @ CHECK: .Ltmp[[TMP4]]
177 @ CHECK: .section e,"ax",%progbits
179 @ CHECK: .Ltmp[[TMP5]]
181 @ CHECK: .Ltmp[[TMP6]]
184 @ Should not switch to section because it has no constant pool
185 @ CHECK-NOT: .section f,"ax",%progbits
187 @ CHECK: .section g,"ax",%progbits
189 @ CHECK: .Ltmp[[TMP7]]
192 @ CHECK: .section h,"ax",%progbits
194 @ CHECK: .Ltmp[[TMP8]]
197 @ CHECK: .section i,"ax",%progbits
199 @ CHECK: .Ltmp[[TMP9]]
202 @ CHECK: .section j,"ax",%progbits
204 @ CHECK: .Ltmp[[TMP10]]
206 @ CHECK: .Ltmp[[TMP11]]
209 @ CHECK: .section k,"ax",%progbits
211 @ CHECK: .Ltmp[[TMP12]]
213 @ CHECK: .Ltmp[[TMP13]]
216 @ CHECK: .section l,"ax",%progbits
218 @ CHECK: .Ltmp[[TMP14]]
220 @ CHECK: .Ltmp[[TMP15]]