Skip to content

Commit e97ba53

Browse files
taiki-ejieyouxu
authored andcommitted
Add bad-reg inline assembly ui test for RISC-V and s390x
1 parent ef972a3 commit e97ba53

9 files changed

+1338
-0
lines changed
+212
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,212 @@
1+
error: invalid register `s1`: s1 is used internally by LLVM and cannot be used as an operand for inline asm
2+
--> $DIR/bad-reg.rs:40:18
3+
|
4+
LL | asm!("", out("s1") _);
5+
| ^^^^^^^^^^^
6+
7+
error: invalid register `fp`: the frame pointer cannot be used as an operand for inline asm
8+
--> $DIR/bad-reg.rs:42:18
9+
|
10+
LL | asm!("", out("fp") _);
11+
| ^^^^^^^^^^^
12+
13+
error: invalid register `sp`: the stack pointer cannot be used as an operand for inline asm
14+
--> $DIR/bad-reg.rs:44:18
15+
|
16+
LL | asm!("", out("sp") _);
17+
| ^^^^^^^^^^^
18+
19+
error: invalid register `gp`: the global pointer cannot be used as an operand for inline asm
20+
--> $DIR/bad-reg.rs:46:18
21+
|
22+
LL | asm!("", out("gp") _);
23+
| ^^^^^^^^^^^
24+
25+
error: invalid register `gp`: the global pointer cannot be used as an operand for inline asm
26+
--> $DIR/bad-reg.rs:48:18
27+
|
28+
LL | asm!("", out("gp") _);
29+
| ^^^^^^^^^^^
30+
31+
error: invalid register `tp`: the thread pointer cannot be used as an operand for inline asm
32+
--> $DIR/bad-reg.rs:50:18
33+
|
34+
LL | asm!("", out("tp") _);
35+
| ^^^^^^^^^^^
36+
37+
error: invalid register `zero`: the zero register cannot be used as an operand for inline asm
38+
--> $DIR/bad-reg.rs:52:18
39+
|
40+
LL | asm!("", out("zero") _);
41+
| ^^^^^^^^^^^^^
42+
43+
error: register class `vreg` can only be used as a clobber, not as an input or output
44+
--> $DIR/bad-reg.rs:103:18
45+
|
46+
LL | asm!("", in("v0") x);
47+
| ^^^^^^^^^^
48+
49+
error: register class `vreg` can only be used as a clobber, not as an input or output
50+
--> $DIR/bad-reg.rs:106:18
51+
|
52+
LL | asm!("", out("v0") x);
53+
| ^^^^^^^^^^^
54+
55+
error: register class `vreg` can only be used as a clobber, not as an input or output
56+
--> $DIR/bad-reg.rs:109:26
57+
|
58+
LL | asm!("/* {} */", in(vreg) x);
59+
| ^^^^^^^^^^
60+
61+
error: register class `vreg` can only be used as a clobber, not as an input or output
62+
--> $DIR/bad-reg.rs:112:26
63+
|
64+
LL | asm!("/* {} */", out(vreg) _);
65+
| ^^^^^^^^^^^
66+
67+
error: cannot use register `x16`: register can't be used with the `e` target feature
68+
--> $DIR/bad-reg.rs:55:18
69+
|
70+
LL | asm!("", out("x16") _);
71+
| ^^^^^^^^^^^^
72+
73+
error: cannot use register `x17`: register can't be used with the `e` target feature
74+
--> $DIR/bad-reg.rs:57:18
75+
|
76+
LL | asm!("", out("x17") _);
77+
| ^^^^^^^^^^^^
78+
79+
error: cannot use register `x18`: register can't be used with the `e` target feature
80+
--> $DIR/bad-reg.rs:59:18
81+
|
82+
LL | asm!("", out("x18") _);
83+
| ^^^^^^^^^^^^
84+
85+
error: cannot use register `x19`: register can't be used with the `e` target feature
86+
--> $DIR/bad-reg.rs:61:18
87+
|
88+
LL | asm!("", out("x19") _);
89+
| ^^^^^^^^^^^^
90+
91+
error: cannot use register `x20`: register can't be used with the `e` target feature
92+
--> $DIR/bad-reg.rs:63:18
93+
|
94+
LL | asm!("", out("x20") _);
95+
| ^^^^^^^^^^^^
96+
97+
error: cannot use register `x21`: register can't be used with the `e` target feature
98+
--> $DIR/bad-reg.rs:65:18
99+
|
100+
LL | asm!("", out("x21") _);
101+
| ^^^^^^^^^^^^
102+
103+
error: cannot use register `x22`: register can't be used with the `e` target feature
104+
--> $DIR/bad-reg.rs:67:18
105+
|
106+
LL | asm!("", out("x22") _);
107+
| ^^^^^^^^^^^^
108+
109+
error: cannot use register `x23`: register can't be used with the `e` target feature
110+
--> $DIR/bad-reg.rs:69:18
111+
|
112+
LL | asm!("", out("x23") _);
113+
| ^^^^^^^^^^^^
114+
115+
error: cannot use register `x24`: register can't be used with the `e` target feature
116+
--> $DIR/bad-reg.rs:71:18
117+
|
118+
LL | asm!("", out("x24") _);
119+
| ^^^^^^^^^^^^
120+
121+
error: cannot use register `x25`: register can't be used with the `e` target feature
122+
--> $DIR/bad-reg.rs:73:18
123+
|
124+
LL | asm!("", out("x25") _);
125+
| ^^^^^^^^^^^^
126+
127+
error: cannot use register `x26`: register can't be used with the `e` target feature
128+
--> $DIR/bad-reg.rs:75:18
129+
|
130+
LL | asm!("", out("x26") _);
131+
| ^^^^^^^^^^^^
132+
133+
error: cannot use register `x27`: register can't be used with the `e` target feature
134+
--> $DIR/bad-reg.rs:77:18
135+
|
136+
LL | asm!("", out("x27") _);
137+
| ^^^^^^^^^^^^
138+
139+
error: cannot use register `x28`: register can't be used with the `e` target feature
140+
--> $DIR/bad-reg.rs:79:18
141+
|
142+
LL | asm!("", out("x28") _);
143+
| ^^^^^^^^^^^^
144+
145+
error: cannot use register `x29`: register can't be used with the `e` target feature
146+
--> $DIR/bad-reg.rs:81:18
147+
|
148+
LL | asm!("", out("x29") _);
149+
| ^^^^^^^^^^^^
150+
151+
error: cannot use register `x30`: register can't be used with the `e` target feature
152+
--> $DIR/bad-reg.rs:83:18
153+
|
154+
LL | asm!("", out("x30") _);
155+
| ^^^^^^^^^^^^
156+
157+
error: cannot use register `x31`: register can't be used with the `e` target feature
158+
--> $DIR/bad-reg.rs:85:18
159+
|
160+
LL | asm!("", out("x31") _);
161+
| ^^^^^^^^^^^^
162+
163+
error: register class `freg` requires at least one of the following target features: d, f
164+
--> $DIR/bad-reg.rs:89:26
165+
|
166+
LL | asm!("/* {} */", in(freg) f);
167+
| ^^^^^^^^^^
168+
169+
error: register class `freg` requires at least one of the following target features: d, f
170+
--> $DIR/bad-reg.rs:91:26
171+
|
172+
LL | asm!("/* {} */", out(freg) _);
173+
| ^^^^^^^^^^^
174+
175+
error: register class `freg` requires at least one of the following target features: d, f
176+
--> $DIR/bad-reg.rs:93:26
177+
|
178+
LL | asm!("/* {} */", in(freg) d);
179+
| ^^^^^^^^^^
180+
181+
error: register class `freg` requires at least one of the following target features: d, f
182+
--> $DIR/bad-reg.rs:96:26
183+
|
184+
LL | asm!("/* {} */", out(freg) d);
185+
| ^^^^^^^^^^^
186+
187+
error: type `i32` cannot be used with this register class
188+
--> $DIR/bad-reg.rs:103:27
189+
|
190+
LL | asm!("", in("v0") x);
191+
| ^
192+
|
193+
= note: register class `vreg` supports these types:
194+
195+
error: type `i32` cannot be used with this register class
196+
--> $DIR/bad-reg.rs:106:28
197+
|
198+
LL | asm!("", out("v0") x);
199+
| ^
200+
|
201+
= note: register class `vreg` supports these types:
202+
203+
error: type `i32` cannot be used with this register class
204+
--> $DIR/bad-reg.rs:109:35
205+
|
206+
LL | asm!("/* {} */", in(vreg) x);
207+
| ^
208+
|
209+
= note: register class `vreg` supports these types:
210+
211+
error: aborting due to 34 previous errors
212+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
error: invalid register `s1`: s1 is used internally by LLVM and cannot be used as an operand for inline asm
2+
--> $DIR/bad-reg.rs:40:18
3+
|
4+
LL | asm!("", out("s1") _);
5+
| ^^^^^^^^^^^
6+
7+
error: invalid register `fp`: the frame pointer cannot be used as an operand for inline asm
8+
--> $DIR/bad-reg.rs:42:18
9+
|
10+
LL | asm!("", out("fp") _);
11+
| ^^^^^^^^^^^
12+
13+
error: invalid register `sp`: the stack pointer cannot be used as an operand for inline asm
14+
--> $DIR/bad-reg.rs:44:18
15+
|
16+
LL | asm!("", out("sp") _);
17+
| ^^^^^^^^^^^
18+
19+
error: invalid register `gp`: the global pointer cannot be used as an operand for inline asm
20+
--> $DIR/bad-reg.rs:46:18
21+
|
22+
LL | asm!("", out("gp") _);
23+
| ^^^^^^^^^^^
24+
25+
error: invalid register `gp`: the global pointer cannot be used as an operand for inline asm
26+
--> $DIR/bad-reg.rs:48:18
27+
|
28+
LL | asm!("", out("gp") _);
29+
| ^^^^^^^^^^^
30+
31+
error: invalid register `tp`: the thread pointer cannot be used as an operand for inline asm
32+
--> $DIR/bad-reg.rs:50:18
33+
|
34+
LL | asm!("", out("tp") _);
35+
| ^^^^^^^^^^^
36+
37+
error: invalid register `zero`: the zero register cannot be used as an operand for inline asm
38+
--> $DIR/bad-reg.rs:52:18
39+
|
40+
LL | asm!("", out("zero") _);
41+
| ^^^^^^^^^^^^^
42+
43+
error: register class `vreg` can only be used as a clobber, not as an input or output
44+
--> $DIR/bad-reg.rs:103:18
45+
|
46+
LL | asm!("", in("v0") x);
47+
| ^^^^^^^^^^
48+
49+
error: register class `vreg` can only be used as a clobber, not as an input or output
50+
--> $DIR/bad-reg.rs:106:18
51+
|
52+
LL | asm!("", out("v0") x);
53+
| ^^^^^^^^^^^
54+
55+
error: register class `vreg` can only be used as a clobber, not as an input or output
56+
--> $DIR/bad-reg.rs:109:26
57+
|
58+
LL | asm!("/* {} */", in(vreg) x);
59+
| ^^^^^^^^^^
60+
61+
error: register class `vreg` can only be used as a clobber, not as an input or output
62+
--> $DIR/bad-reg.rs:112:26
63+
|
64+
LL | asm!("/* {} */", out(vreg) _);
65+
| ^^^^^^^^^^^
66+
67+
error: type `i32` cannot be used with this register class
68+
--> $DIR/bad-reg.rs:103:27
69+
|
70+
LL | asm!("", in("v0") x);
71+
| ^
72+
|
73+
= note: register class `vreg` supports these types:
74+
75+
error: type `i32` cannot be used with this register class
76+
--> $DIR/bad-reg.rs:106:28
77+
|
78+
LL | asm!("", out("v0") x);
79+
| ^
80+
|
81+
= note: register class `vreg` supports these types:
82+
83+
error: type `i32` cannot be used with this register class
84+
--> $DIR/bad-reg.rs:109:35
85+
|
86+
LL | asm!("/* {} */", in(vreg) x);
87+
| ^
88+
|
89+
= note: register class `vreg` supports these types:
90+
91+
error: aborting due to 14 previous errors
92+

0 commit comments

Comments
 (0)