1 @ RUN
: not llvm-mc
-triple
=thumbv7-unknown-linux-gnueabi
-arm-implicit-it
=thumb
-show-encoding
< %s
2>&1 | FileCheck
%s
4 @ Note
: The error stream for XFAIL needs to get checked first.
18 str.w
r1, [r2, #-256]!
26 @ CHECK
: error
: destination register
and base register can
't be identical
27 @ CHECK-NEXT: ldr.w r1, [r1, #-4]!
28 @ CHECK: error: invalid instruction, any one of the following would fix this:
29 @ CHECK-NEXT: ldr.w r1, [r0, #256]!
30 @ CHECK: note: invalid operand for instruction
31 @ CHECK: note: too many operands for instruction
32 @ CHECK: error: invalid operand for instruction
33 @ CHECK-NEXT: ldr.w r1, [r0, #-256]!
34 @ CHECK: error: invalid instruction, any one of the following would fix this:
35 @ CHECK-NEXT: ldr.w r1, [pc, #-4]!
36 @ CHECK: note: invalid operand for instruction
37 @ CHECK: note: too many operands for instruction
38 @ CHECK: error: destination register and base register can't be identical
39 @ CHECK-NEXT
: ldr.w
r1, [r1], #4
40 @ CHECK
: error
: destination register
and base register can
't be identical
41 @ CHECK-NEXT: ldr.w r0, [r0], #4
42 @ CHECK: error: operand must be in range [-255, 255]
43 @ CHECK-NEXT: ldr.w r0, [r1], #256
44 @ CHECK: error: operand must be in range [-255, 255]
45 @ CHECK-NEXT: ldr.w r0, [r1], #-256
46 @ CHECK: error: destination register and base register can't be identical
47 @ CHECK-NEXT
: str.w
r0, [r0, #-4]!
48 @ CHECK
: error
: operand must
be a register in range
[r0, r14]
49 @ CHECK-NEXT
: str.w pc
, [r0, #-4]!
50 @ CHECK
: error
: invalid operand for instruction
51 @ CHECK-NEXT
: str.w
r1, [pc
, #-4]!
52 @ CHECK
: error
: invalid instruction
, any one of the following would fix this
:
53 @ CHECK-NEXT
: str.w
r1, [r2, #256]!
54 @ CHECK
: note
: invalid operand for instruction
55 @ CHECK
: note
: too many operands for instruction
56 @ CHECK
: error
: invalid operand for instruction
57 @ CHECK-NEXT
: str.w
r1, [r2, #-256]!
58 @ CHECK
: error
: destination register
and base register can
't be identical
59 @ CHECK-NEXT: str.w r0, [r0], #4
60 @ CHECK: error: operand must be a register in range [r0, r14]
61 @ CHECK-NEXT: str.w pc, [r0], #4
62 @ CHECK: error: operand must be in range [-255, 255]
63 @ CHECK-NEXT: str.w r1, [r0], #256
64 @ CHECK: error: operand must be in range [-255, 255]
65 @ CHECK-NEXT: str.w r1, [r0], #-256
69 @ Simple checks that we get the same encoding w/ and w/o the .w suffix.
82 @ CHECK: ldr r3, [r1], #4 @ encoding: [0x51,0xf8,0x04,0x3b]
83 @ CHECK: ldr r3, [r1], #4 @ encoding: [0x51,0xf8,0x04,0x3b]
84 @ CHECK: str r3, [r0], #4 @ encoding: [0x40,0xf8,0x04,0x3b]
85 @ CHECK: str r3, [r0], #4 @ encoding: [0x40,0xf8,0x04,0x3b]
86 @ CHECK: ldr r3, [r1, #-4]! @ encoding: [0x51,0xf8,0x04,0x3d]
87 @ CHECK: ldr r3, [r1, #-4]! @ encoding: [0x51,0xf8,0x04,0x3d]
88 @ CHECK: str r3, [r0, #-4]! @ encoding: [0x40,0xf8,0x04,0x3d]
89 @ CHECK: str r3, [r0, #-4]! @ encoding: [0x40,0xf8,0x04,0x3d]
91 @@ LDR pre-increment w/ writeback
94 ldr.w sp, [r1, #-4]! @ TODO: GAS warns for this
100 ldr.w r1, [r0, #255]!
101 ldr.w r1, [r0, #-255]!
104 ldreq.w r1, [r0, #255]!
105 ldrle.w r1, [r0, #255]!
107 @ CHECK: ldr r0, [r1, #-4]! @ encoding: [0x51,0xf8,0x04,0x0d]
108 @ CHECK: ldr sp, [r1, #-4]! @ encoding: [0x51,0xf8,0x04,0xdd]
109 @ CHECK: ldr pc, [r1, #-4]! @ encoding: [0x51,0xf8,0x04,0xfd]
110 @ CHECK: ldr r1, [r0, #-4]! @ encoding: [0x50,0xf8,0x04,0x1d]
111 @ CHECK: ldr r1, [sp, #-4]! @ encoding: [0x5d,0xf8,0x04,0x1d]
112 @ CHECK: ldr r1, [r0, #255]! @ encoding: [0x50,0xf8,0xff,0x1f]
113 @ CHECK: ldr r1, [r0, #-255]! @ encoding: [0x50,0xf8,0xff,0x1d]
114 @ CHECK: ldr r1, [r0, #0]! @ encoding: [0x50,0xf8,0x00,0x1f]
115 @ CHECK: it eq @ encoding: [0x08,0xbf]
116 @ CHECK: ldreq r1, [r0, #255]! @ encoding: [0x50,0xf8,0xff,0x1f]
117 @ CHECK: it le @ encoding: [0xd8,0xbf]
118 @ CHECK: ldrle r1, [r0, #255]! @ encoding: [0x50,0xf8,0xff,0x1f]
120 @@ LDR post-increment
123 ldr.w sp, [r1], #4 @ TODO: GAS warns for this
128 ldr.w r0, [pc], #4 @ TODO: GAS warns for this
132 ldr.w r0, [r1], #-255
134 ldreq.w r0, [r1], #255
135 ldrle.w r0, [r1], #255
137 @ CHECK: ldr r0, [r1], #4 @ encoding: [0x51,0xf8,0x04,0x0b]
138 @ CHECK: ldr sp, [r1], #4 @ encoding: [0x51,0xf8,0x04,0xdb]
139 @ CHECK: ldr pc, [r1], #4 @ encoding: [0x51,0xf8,0x04,0xfb]
140 @ CHECK: ldr r0, [r1], #4 @ encoding: [0x51,0xf8,0x04,0x0b]
141 @ CHECK: ldr r0, [sp], #4 @ encoding: [0x5d,0xf8,0x04,0x0b]
142 @ CHECK: ldr r0, [pc], #4 @ encoding: [0x5f,0xf8,0x04,0x0b]
143 @ CHECK: ldr r0, [r1], #255 @ encoding: [0x51,0xf8,0xff,0x0b]
144 @ CHECK: ldr r0, [r1], #0 @ encoding: [0x51,0xf8,0x00,0x0b]
145 @ CHECK: ldr r0, [r1], #-255 @ encoding: [0x51,0xf8,0xff,0x09]
146 @ CHECK: it eq @ encoding: [0x08,0xbf]
147 @ CHECK: ldreq r0, [r1], #255 @ encoding: [0x51,0xf8,0xff,0x0b]
148 @ CHECK: it le @ encoding: [0xd8,0xbf]
149 @ CHECK: ldrle r0, [r1], #255 @ encoding: [0x51,0xf8,0xff,0x0b]
151 @@ STR pre-increment w/ writeback
159 str.w r1, [r2, #255]!
161 str.w r1, [r2, #-255]!
163 streq.w r1, [r2, #255]!
164 strle.w r1, [r2, #255]!
166 @ CHECK: str r1, [r0, #-4]! @ encoding: [0x40,0xf8,0x04,0x1d]
167 @ CHECK: str sp, [r0, #-4]! @ encoding: [0x40,0xf8,0x04,0xdd]
168 @ CHECK: str r1, [r2, #-4]! @ encoding: [0x42,0xf8,0x04,0x1d]
169 @ CHECK: str r1, [sp, #-4]! @ encoding: [0x4d,0xf8,0x04,0x1d]
170 @ CHECK: str r1, [r2, #255]! @ encoding: [0x42,0xf8,0xff,0x1f]
171 @ CHECK: str r1, [r2, #0]! @ encoding: [0x42,0xf8,0x00,0x1f]
172 @ CHECK: str r1, [r2, #-255]! @ encoding: [0x42,0xf8,0xff,0x1d]
173 @ CHECK: it eq @ encoding: [0x08,0xbf]
174 @ CHECK: streq r1, [r2, #255]! @ encoding: [0x42,0xf8,0xff,0x1f]
175 @ CHECK: it le @ encoding: [0xd8,0xbf]
176 @ CHECK: strle r1, [r2, #255]! @ encoding: [0x42,0xf8,0xff,0x1f]
178 @@ STR post-increment
185 str.w r0, [pc], #4 @ TODO: GAS warns for this.
189 str.w r1, [r0], #-255
191 streq.w r1, [r0], #255
192 strle.w r1, [r0], #255
194 @ CHECK: str r1, [r0], #4 @ encoding: [0x40,0xf8,0x04,0x1b]
195 @ CHECK: str sp, [r0], #4 @ encoding: [0x40,0xf8,0x04,0xdb]
196 @ CHECK: str r0, [r1], #4 @ encoding: [0x41,0xf8,0x04,0x0b]
197 @ CHECK: str r0, [sp], #4 @ encoding: [0x4d,0xf8,0x04,0x0b]
198 @ CHECK: str r0, [pc], #4 @ encoding: [0x4f,0xf8,0x04,0x0b]
199 @ CHECK: str r1, [r0], #255 @ encoding: [0x40,0xf8,0xff,0x1b]
200 @ CHECK: str r1, [r0], #0 @ encoding: [0x40,0xf8,0x00,0x1b]
201 @ CHECK: str r1, [r0], #-255 @ encoding: [0x40,0xf8,0xff,0x19]
202 @ CHECK: it eq @ encoding: [0x08,0xbf]
203 @ CHECK: streq r1, [r0], #255 @ encoding: [0x40,0xf8,0xff,0x1b]
204 @ CHECK: it le @ encoding: [0xd8,0xbf]
205 @ CHECK: strle r1, [r0], #255 @ encoding: [0x40,0xf8,0xff,0x1b]