• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# RUN: not llvm-mc -triple s390x-linux-gnu < %s 2> %t
2# RUN: FileCheck < %t %s
3
4# Test GR32 operands
5#
6#CHECK: error: invalid operand for instruction
7#CHECK: lr	%f0,%r1
8#CHECK: error: invalid operand for instruction
9#CHECK: lr	%a0,%r1
10#CHECK: error: invalid operand for instruction
11#CHECK: lr	%c0,%r1
12#CHECK: error: invalid operand for instruction
13#CHECK: lr	%r0,%f1
14#CHECK: error: invalid operand for instruction
15#CHECK: lr	%r0,%a1
16#CHECK: error: invalid operand for instruction
17#CHECK: lr	%r0,%c1
18#CHECK: error: invalid operand for instruction
19#CHECK: lr	%r0,0
20#CHECK: error: invalid operand for instruction
21#CHECK: lr	%r0,0(%r1)
22
23	lr	%f0,%r1
24	lr	%a0,%r1
25	lr	%c0,%r1
26	lr	%r0,%f1
27	lr	%r0,%a1
28	lr	%r0,%c1
29	lr	%r0,0
30	lr	%r0,0(%r1)
31
32# Test GR64 operands
33#
34#CHECK: error: invalid operand for instruction
35#CHECK: lgr	%f0,%r1
36#CHECK: error: invalid operand for instruction
37#CHECK: lgr	%a0,%r1
38#CHECK: error: invalid operand for instruction
39#CHECK: lgr	%c0,%r1
40#CHECK: error: invalid operand for instruction
41#CHECK: lgr	%r0,%f1
42#CHECK: error: invalid operand for instruction
43#CHECK: lgr	%r0,%a1
44#CHECK: error: invalid operand for instruction
45#CHECK: lgr	%r0,%c1
46#CHECK: error: invalid operand for instruction
47#CHECK: lgr	%r0,0
48#CHECK: error: invalid operand for instruction
49#CHECK: lgr	%r0,0(%r1)
50
51	lgr	%f0,%r1
52	lgr	%a0,%r1
53	lgr	%c0,%r1
54	lgr	%r0,%f1
55	lgr	%r0,%a1
56	lgr	%r0,%c1
57	lgr	%r0,0
58	lgr	%r0,0(%r1)
59
60# Test GR128 operands
61#
62#CHECK: error: invalid register pair
63#CHECK: dlr	%r1,%r0
64#CHECK: error: invalid register pair
65#CHECK: dlr	%r3,%r0
66#CHECK: error: invalid register pair
67#CHECK: dlr	%r5,%r0
68#CHECK: error: invalid register pair
69#CHECK: dlr	%r7,%r0
70#CHECK: error: invalid register pair
71#CHECK: dlr	%r9,%r0
72#CHECK: error: invalid register pair
73#CHECK: dlr	%r11,%r0
74#CHECK: error: invalid register pair
75#CHECK: dlr	%r13,%r0
76#CHECK: error: invalid register pair
77#CHECK: dlr	%r15,%r0
78#CHECK: error: invalid operand for instruction
79#CHECK: dlr	%f0,%r1
80#CHECK: error: invalid operand for instruction
81#CHECK: dlr	%a0,%r1
82#CHECK: error: invalid operand for instruction
83#CHECK: dlr	%c0,%r1
84#CHECK: error: invalid operand for instruction
85#CHECK: dlr	%r0,%f1
86#CHECK: error: invalid operand for instruction
87#CHECK: dlr	%r0,%a1
88#CHECK: error: invalid operand for instruction
89#CHECK: dlr	%r0,%c1
90#CHECK: error: invalid operand for instruction
91#CHECK: dlr	%r0,0
92#CHECK: error: invalid operand for instruction
93#CHECK: dlr	%r0,0(%r1)
94
95	dlr	%r1,%r0
96	dlr	%r3,%r0
97	dlr	%r5,%r0
98	dlr	%r7,%r0
99	dlr	%r9,%r0
100	dlr	%r11,%r0
101	dlr	%r13,%r0
102	dlr	%r15,%r0
103	dlr	%f0,%r1
104	dlr	%a0,%r1
105	dlr	%c0,%r1
106	dlr	%r0,%f1
107	dlr	%r0,%a1
108	dlr	%r0,%c1
109	dlr	%r0,0
110	dlr	%r0,0(%r1)
111
112# Test FP32 operands
113#
114#CHECK: error: invalid operand for instruction
115#CHECK: ler	%r0,%f1
116#CHECK: error: invalid operand for instruction
117#CHECK: ler	%a0,%f1
118#CHECK: error: invalid operand for instruction
119#CHECK: ler	%c0,%f1
120#CHECK: error: invalid operand for instruction
121#CHECK: ler	%f0,%r1
122#CHECK: error: invalid operand for instruction
123#CHECK: ler	%f0,%a1
124#CHECK: error: invalid operand for instruction
125#CHECK: ler	%f0,%c1
126#CHECK: error: invalid operand for instruction
127#CHECK: ler	%f0,0
128#CHECK: error: invalid operand for instruction
129#CHECK: ler	%f0,0(%r1)
130
131	ler	%r0,%f1
132	ler	%a0,%f1
133	ler	%c0,%f1
134	ler	%f0,%r1
135	ler	%f0,%a1
136	ler	%f0,%c1
137	ler	%f0,0
138	ler	%f0,0(%r1)
139
140# Test FP64 operands
141#
142#CHECK: error: invalid operand for instruction
143#CHECK: ldr	%r0,%f1
144#CHECK: error: invalid operand for instruction
145#CHECK: ldr	%a0,%f1
146#CHECK: error: invalid operand for instruction
147#CHECK: ldr	%c0,%f1
148#CHECK: error: invalid operand for instruction
149#CHECK: ldr	%f0,%r1
150#CHECK: error: invalid operand for instruction
151#CHECK: ldr	%f0,%a1
152#CHECK: error: invalid operand for instruction
153#CHECK: ldr	%f0,%c1
154#CHECK: error: invalid operand for instruction
155#CHECK: ldr	%f0,0
156#CHECK: error: invalid operand for instruction
157#CHECK: ldr	%f0,0(%r1)
158
159	ldr	%r0,%f1
160	ldr	%a0,%f1
161	ldr	%c0,%f1
162	ldr	%f0,%r1
163	ldr	%f0,%a1
164	ldr	%f0,%c1
165	ldr	%f0,0
166	ldr	%f0,0(%r1)
167
168# Test FP128 operands
169#
170#CHECK: error: invalid register pair
171#CHECK: lxr	%f2,%f0
172#CHECK: error: invalid register pair
173#CHECK: lxr	%f0,%f3
174#CHECK: error: invalid register pair
175#CHECK: lxr	%f6,%f0
176#CHECK: error: invalid register pair
177#CHECK: lxr	%f0,%f7
178#CHECK: error: invalid register pair
179#CHECK: lxr	%f10,%f0
180#CHECK: error: invalid register pair
181#CHECK: lxr	%f0,%f11
182#CHECK: error: invalid register pair
183#CHECK: lxr	%f14,%f0
184#CHECK: error: invalid register pair
185#CHECK: lxr	%f0,%f15
186#CHECK: error: invalid operand for instruction
187#CHECK: lxr	%r0,%f1
188#CHECK: error: invalid operand for instruction
189#CHECK: lxr	%a0,%f1
190#CHECK: error: invalid operand for instruction
191#CHECK: lxr	%c0,%f1
192#CHECK: error: invalid operand for instruction
193#CHECK: lxr	%f0,%r1
194#CHECK: error: invalid operand for instruction
195#CHECK: lxr	%f0,%a1
196#CHECK: error: invalid operand for instruction
197#CHECK: lxr	%f0,%c1
198#CHECK: error: invalid operand for instruction
199#CHECK: lxr	%f0,0
200#CHECK: error: invalid operand for instruction
201#CHECK: lxr	%f0,0(%r1)
202
203	lxr	%f2,%f0
204	lxr	%f0,%f3
205	lxr	%f6,%f0
206	lxr	%f0,%f7
207	lxr	%f10,%f0
208	lxr	%f0,%f11
209	lxr	%f14,%f0
210	lxr	%f0,%f15
211	lxr	%r0,%f1
212	lxr	%a0,%f1
213	lxr	%c0,%f1
214	lxr	%f0,%r1
215	lxr	%f0,%a1
216	lxr	%f0,%c1
217	lxr	%f0,0
218	lxr	%f0,0(%r1)
219
220# Test access register operands
221#
222#CHECK: error: invalid operand for instruction
223#CHECK: ear	%r0,%r0
224#CHECK: error: invalid operand for instruction
225#CHECK: ear	%r0,%f0
226#CHECK: error: invalid operand for instruction
227#CHECK: ear	%r0,%c0
228#CHECK: error: invalid operand for instruction
229#CHECK: ear	%r0,0
230#CHECK: error: invalid operand for instruction
231#CHECK: ear	%r0,0(%r1)
232
233	ear	%r0,%r0
234	ear	%r0,%f0
235	ear	%r0,%c0
236	ear	%r0,0
237	ear	%r0,0(%r1)
238
239# Test control register operands
240#
241#CHECK: error: invalid operand for instruction
242#CHECK: lctl	%c0,%r0,0
243#CHECK: lctl	%c0,%f0,0
244#CHECK: lctl	%c0,%a0,0
245#CHECK: lctl	%c0,0,0
246#CHECK: lctl	%c0,0(%r1),0
247
248	lctl	%c0,%r0,0
249	lctl	%c0,%f0,0
250	lctl	%c0,%a0,0
251	lctl	%c0,0,0
252	lctl	%c0,0(%r1),0
253
254	.cfi_startproc
255
256# Test general register parsing, with no predetermined class in mind.
257#
258#CHECK: error: register expected
259#CHECK: .cfi_offset r0,0
260#CHECK: error: invalid register
261#CHECK: .cfi_offset %,0
262#CHECK: error: invalid register
263#CHECK: .cfi_offset %r,0
264#CHECK: error: invalid register
265#CHECK: .cfi_offset %f,0
266#CHECK: error: invalid register
267#CHECK: .cfi_offset %a,0
268#CHECK: error: invalid register
269#CHECK: .cfi_offset %c,0
270#CHECK: error: invalid register
271#CHECK: .cfi_offset %0,0
272#CHECK: error: invalid register
273#CHECK: .cfi_offset %r16,0
274#CHECK: error: invalid register
275#CHECK: .cfi_offset %f16,0
276#CHECK: error: invalid register
277#CHECK: .cfi_offset %a16,0
278#CHECK: error: invalid register
279#CHECK: .cfi_offset %c16,0
280#CHECK: error: invalid register
281#CHECK: .cfi_offset %reef,0
282#CHECK: error: invalid register
283#CHECK: .cfi_offset %arid,0
284
285	.cfi_offset r0,0
286	.cfi_offset %,0
287	.cfi_offset %r,0
288	.cfi_offset %f,0
289	.cfi_offset %a,0
290	.cfi_offset %c,0
291	.cfi_offset %0,0
292	.cfi_offset %r16,0
293	.cfi_offset %f16,0
294	.cfi_offset %a16,0
295	.cfi_offset %c16,0
296	.cfi_offset %reef,0
297	.cfi_offset %arid,0
298
299	.cfi_endproc
300
301#CHECK: error: %r0 used in an address
302#CHECK: sll	%r2,8(%r0)
303#CHECK: error: %r0 used in an address
304#CHECK: br	%r0
305#CHECK: error: %r0 used in an address
306#CHECK: l	%r1,8(%r0)
307#CHECK: error: %r0 used in an address
308#CHECK: l	%r1,8(%r0,%r15)
309#CHECK: error: %r0 used in an address
310#CHECK: l	%r1,8(%r15,%r0)
311
312	sll	%r2,8(%r0)
313	br	%r0
314	l	%r1,8(%r0)
315	l	%r1,8(%r0,%r15)
316	l	%r1,8(%r15,%r0)
317