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, .Ltmp0
21 @ loading multiple constants
22 .section c,"ax",%progbits
26 @ CHECK: ldr r0, .Ltmp1
32 @ CHECK: ldr r0, .Ltmp2
36 @ TODO: the same constants should have the same constant pool location
37 .section d,"ax",%progbits
41 @ CHECK: ldr r0, .Ltmp3
50 @ CHECK: ldr r0, .Ltmp4
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, .Ltmp5
68 .section f, "ax", %progbits
75 .section e, "ax", %progbits
80 @ CHECK: ldr r0, .Ltmp6
85 @ Check that symbols can be loaded using ldr pseudo
88 @ load an undefined symbol
89 .section g,"ax",%progbits
93 @ CHECK: ldr r0, .Ltmp7
95 @ load a symbol from another section
96 .section h,"ax",%progbits
100 @ CHECK: ldr r0, .Ltmp8
102 @ load a symbol from the same section
103 .section i,"ax",%progbits
107 @ CHECK: ldr r0, .Ltmp9
114 .section j,"ax",%progbits
115 @ mix of symbols and constants
121 @ CHECK: ldr r0, .Ltmp10
125 @ CHECK: ldr r0, .Ltmp11
129 @ Check for correct usage in other contexts
133 .macro useit_in_a_macro
137 .section k,"ax",%progbits
141 @ CHECK: ldr r0, .Ltmp12
142 @ CHECK: ldr r0, .Ltmp13
144 @ usage with expressions
145 .section l, "ax", %progbits
149 @ CHECK: ldr r0, .Ltmp14
152 @ CHECK: ldr r0, .Ltmp15
158 @ CHECK: .section b,"ax",%progbits
160 @ CHECK-LABEL: .Ltmp0:
163 @ CHECK: .section c,"ax",%progbits
165 @ CHECK-LABEL: .Ltmp1:
167 @ CHECK-LABEL: .Ltmp2:
170 @ CHECK: .section d,"ax",%progbits
172 @ CHECK-LABEL: .Ltmp3:
174 @ CHECK-LABEL: .Ltmp4:
177 @ CHECK: .section e,"ax",%progbits
179 @ CHECK-LABEL: .Ltmp5:
181 @ CHECK-LABEL: .Ltmp6:
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-LABEL: .Ltmp7:
192 @ CHECK: .section h,"ax",%progbits
194 @ CHECK-LABEL: .Ltmp8:
197 @ CHECK: .section i,"ax",%progbits
199 @ CHECK-LABEL: .Ltmp9:
202 @ CHECK: .section j,"ax",%progbits
204 @ CHECK-LABEL: .Ltmp10:
206 @ CHECK-LABEL: .Ltmp11:
209 @ CHECK: .section k,"ax",%progbits
211 @ CHECK-LABEL: .Ltmp12:
213 @ CHECK-LABEL: .Ltmp13:
216 @ CHECK: .section l,"ax",%progbits
218 @ CHECK-LABEL: .Ltmp14:
220 @ CHECK-LABEL: .Ltmp15: