Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 0fbf08c

Browse files
committedNov 3, 2024·
Move tests/ui/abi/riscv32e-registers.rs to ui/asm/riscv
This also adds comments explaining the difference to bad-reg.rs.
1 parent a7520ad commit 0fbf08c

11 files changed

+168
-162
lines changed
 

‎tests/ui/asm/riscv/bad-reg.riscv32e.stderr

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,207 +1,207 @@
11
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:31:18
2+
--> $DIR/bad-reg.rs:34:18
33
|
44
LL | asm!("", out("s1") _);
55
| ^^^^^^^^^^^
66

77
error: invalid register `fp`: the frame pointer cannot be used as an operand for inline asm
8-
--> $DIR/bad-reg.rs:33:18
8+
--> $DIR/bad-reg.rs:36:18
99
|
1010
LL | asm!("", out("fp") _);
1111
| ^^^^^^^^^^^
1212

1313
error: invalid register `sp`: the stack pointer cannot be used as an operand for inline asm
14-
--> $DIR/bad-reg.rs:35:18
14+
--> $DIR/bad-reg.rs:38:18
1515
|
1616
LL | asm!("", out("sp") _);
1717
| ^^^^^^^^^^^
1818

1919
error: invalid register `gp`: the global pointer cannot be used as an operand for inline asm
20-
--> $DIR/bad-reg.rs:37:18
20+
--> $DIR/bad-reg.rs:40:18
2121
|
2222
LL | asm!("", out("gp") _);
2323
| ^^^^^^^^^^^
2424

2525
error: invalid register `gp`: the global pointer cannot be used as an operand for inline asm
26-
--> $DIR/bad-reg.rs:39:18
26+
--> $DIR/bad-reg.rs:42:18
2727
|
2828
LL | asm!("", out("gp") _);
2929
| ^^^^^^^^^^^
3030

3131
error: invalid register `tp`: the thread pointer cannot be used as an operand for inline asm
32-
--> $DIR/bad-reg.rs:41:18
32+
--> $DIR/bad-reg.rs:44:18
3333
|
3434
LL | asm!("", out("tp") _);
3535
| ^^^^^^^^^^^
3636

3737
error: invalid register `zero`: the zero register cannot be used as an operand for inline asm
38-
--> $DIR/bad-reg.rs:43:18
38+
--> $DIR/bad-reg.rs:46:18
3939
|
4040
LL | asm!("", out("zero") _);
4141
| ^^^^^^^^^^^^^
4242

4343
error: register class `vreg` can only be used as a clobber, not as an input or output
44-
--> $DIR/bad-reg.rs:94:18
44+
--> $DIR/bad-reg.rs:97:18
4545
|
4646
LL | asm!("", in("v0") x);
4747
| ^^^^^^^^^^
4848

4949
error: register class `vreg` can only be used as a clobber, not as an input or output
50-
--> $DIR/bad-reg.rs:97:18
50+
--> $DIR/bad-reg.rs:100:18
5151
|
5252
LL | asm!("", out("v0") x);
5353
| ^^^^^^^^^^^
5454

5555
error: register class `vreg` can only be used as a clobber, not as an input or output
56-
--> $DIR/bad-reg.rs:100:26
56+
--> $DIR/bad-reg.rs:103:26
5757
|
5858
LL | asm!("/* {} */", in(vreg) x);
5959
| ^^^^^^^^^^
6060

6161
error: register class `vreg` can only be used as a clobber, not as an input or output
62-
--> $DIR/bad-reg.rs:103:26
62+
--> $DIR/bad-reg.rs:106:26
6363
|
6464
LL | asm!("/* {} */", out(vreg) _);
6565
| ^^^^^^^^^^^
6666

6767
error: cannot use register `x16`: register can't be used with the `e` target feature
68-
--> $DIR/bad-reg.rs:46:18
68+
--> $DIR/bad-reg.rs:49:18
6969
|
7070
LL | asm!("", out("x16") _);
7171
| ^^^^^^^^^^^^
7272

7373
error: cannot use register `x17`: register can't be used with the `e` target feature
74-
--> $DIR/bad-reg.rs:48:18
74+
--> $DIR/bad-reg.rs:51:18
7575
|
7676
LL | asm!("", out("x17") _);
7777
| ^^^^^^^^^^^^
7878

7979
error: cannot use register `x18`: register can't be used with the `e` target feature
80-
--> $DIR/bad-reg.rs:50:18
80+
--> $DIR/bad-reg.rs:53:18
8181
|
8282
LL | asm!("", out("x18") _);
8383
| ^^^^^^^^^^^^
8484

8585
error: cannot use register `x19`: register can't be used with the `e` target feature
86-
--> $DIR/bad-reg.rs:52:18
86+
--> $DIR/bad-reg.rs:55:18
8787
|
8888
LL | asm!("", out("x19") _);
8989
| ^^^^^^^^^^^^
9090

9191
error: cannot use register `x20`: register can't be used with the `e` target feature
92-
--> $DIR/bad-reg.rs:54:18
92+
--> $DIR/bad-reg.rs:57:18
9393
|
9494
LL | asm!("", out("x20") _);
9595
| ^^^^^^^^^^^^
9696

9797
error: cannot use register `x21`: register can't be used with the `e` target feature
98-
--> $DIR/bad-reg.rs:56:18
98+
--> $DIR/bad-reg.rs:59:18
9999
|
100100
LL | asm!("", out("x21") _);
101101
| ^^^^^^^^^^^^
102102

103103
error: cannot use register `x22`: register can't be used with the `e` target feature
104-
--> $DIR/bad-reg.rs:58:18
104+
--> $DIR/bad-reg.rs:61:18
105105
|
106106
LL | asm!("", out("x22") _);
107107
| ^^^^^^^^^^^^
108108

109109
error: cannot use register `x23`: register can't be used with the `e` target feature
110-
--> $DIR/bad-reg.rs:60:18
110+
--> $DIR/bad-reg.rs:63:18
111111
|
112112
LL | asm!("", out("x23") _);
113113
| ^^^^^^^^^^^^
114114

115115
error: cannot use register `x24`: register can't be used with the `e` target feature
116-
--> $DIR/bad-reg.rs:62:18
116+
--> $DIR/bad-reg.rs:65:18
117117
|
118118
LL | asm!("", out("x24") _);
119119
| ^^^^^^^^^^^^
120120

121121
error: cannot use register `x25`: register can't be used with the `e` target feature
122-
--> $DIR/bad-reg.rs:64:18
122+
--> $DIR/bad-reg.rs:67:18
123123
|
124124
LL | asm!("", out("x25") _);
125125
| ^^^^^^^^^^^^
126126

127127
error: cannot use register `x26`: register can't be used with the `e` target feature
128-
--> $DIR/bad-reg.rs:66:18
128+
--> $DIR/bad-reg.rs:69:18
129129
|
130130
LL | asm!("", out("x26") _);
131131
| ^^^^^^^^^^^^
132132

133133
error: cannot use register `x27`: register can't be used with the `e` target feature
134-
--> $DIR/bad-reg.rs:68:18
134+
--> $DIR/bad-reg.rs:71:18
135135
|
136136
LL | asm!("", out("x27") _);
137137
| ^^^^^^^^^^^^
138138

139139
error: cannot use register `x28`: register can't be used with the `e` target feature
140-
--> $DIR/bad-reg.rs:70:18
140+
--> $DIR/bad-reg.rs:73:18
141141
|
142142
LL | asm!("", out("x28") _);
143143
| ^^^^^^^^^^^^
144144

145145
error: cannot use register `x29`: register can't be used with the `e` target feature
146-
--> $DIR/bad-reg.rs:72:18
146+
--> $DIR/bad-reg.rs:75:18
147147
|
148148
LL | asm!("", out("x29") _);
149149
| ^^^^^^^^^^^^
150150

151151
error: cannot use register `x30`: register can't be used with the `e` target feature
152-
--> $DIR/bad-reg.rs:74:18
152+
--> $DIR/bad-reg.rs:77:18
153153
|
154154
LL | asm!("", out("x30") _);
155155
| ^^^^^^^^^^^^
156156

157157
error: cannot use register `x31`: register can't be used with the `e` target feature
158-
--> $DIR/bad-reg.rs:76:18
158+
--> $DIR/bad-reg.rs:79:18
159159
|
160160
LL | asm!("", out("x31") _);
161161
| ^^^^^^^^^^^^
162162

163163
error: register class `freg` requires at least one of the following target features: d, f
164-
--> $DIR/bad-reg.rs:80:26
164+
--> $DIR/bad-reg.rs:83:26
165165
|
166166
LL | asm!("/* {} */", in(freg) f);
167167
| ^^^^^^^^^^
168168

169169
error: register class `freg` requires at least one of the following target features: d, f
170-
--> $DIR/bad-reg.rs:82:26
170+
--> $DIR/bad-reg.rs:85:26
171171
|
172172
LL | asm!("/* {} */", out(freg) _);
173173
| ^^^^^^^^^^^
174174

175175
error: register class `freg` requires at least one of the following target features: d, f
176-
--> $DIR/bad-reg.rs:84:26
176+
--> $DIR/bad-reg.rs:87:26
177177
|
178178
LL | asm!("/* {} */", in(freg) d);
179179
| ^^^^^^^^^^
180180

181181
error: register class `freg` requires at least one of the following target features: d, f
182-
--> $DIR/bad-reg.rs:87:26
182+
--> $DIR/bad-reg.rs:90:26
183183
|
184184
LL | asm!("/* {} */", out(freg) d);
185185
| ^^^^^^^^^^^
186186

187187
error: type `i32` cannot be used with this register class
188-
--> $DIR/bad-reg.rs:94:27
188+
--> $DIR/bad-reg.rs:97:27
189189
|
190190
LL | asm!("", in("v0") x);
191191
| ^
192192
|
193193
= note: register class `vreg` supports these types:
194194

195195
error: type `i32` cannot be used with this register class
196-
--> $DIR/bad-reg.rs:97:28
196+
--> $DIR/bad-reg.rs:100:28
197197
|
198198
LL | asm!("", out("v0") x);
199199
| ^
200200
|
201201
= note: register class `vreg` supports these types:
202202

203203
error: type `i32` cannot be used with this register class
204-
--> $DIR/bad-reg.rs:100:35
204+
--> $DIR/bad-reg.rs:103:35
205205
|
206206
LL | asm!("/* {} */", in(vreg) x);
207207
| ^

‎tests/ui/asm/riscv/bad-reg.riscv32gc.stderr

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,87 +1,87 @@
11
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:31:18
2+
--> $DIR/bad-reg.rs:34:18
33
|
44
LL | asm!("", out("s1") _);
55
| ^^^^^^^^^^^
66

77
error: invalid register `fp`: the frame pointer cannot be used as an operand for inline asm
8-
--> $DIR/bad-reg.rs:33:18
8+
--> $DIR/bad-reg.rs:36:18
99
|
1010
LL | asm!("", out("fp") _);
1111
| ^^^^^^^^^^^
1212

1313
error: invalid register `sp`: the stack pointer cannot be used as an operand for inline asm
14-
--> $DIR/bad-reg.rs:35:18
14+
--> $DIR/bad-reg.rs:38:18
1515
|
1616
LL | asm!("", out("sp") _);
1717
| ^^^^^^^^^^^
1818

1919
error: invalid register `gp`: the global pointer cannot be used as an operand for inline asm
20-
--> $DIR/bad-reg.rs:37:18
20+
--> $DIR/bad-reg.rs:40:18
2121
|
2222
LL | asm!("", out("gp") _);
2323
| ^^^^^^^^^^^
2424

2525
error: invalid register `gp`: the global pointer cannot be used as an operand for inline asm
26-
--> $DIR/bad-reg.rs:39:18
26+
--> $DIR/bad-reg.rs:42:18
2727
|
2828
LL | asm!("", out("gp") _);
2929
| ^^^^^^^^^^^
3030

3131
error: invalid register `tp`: the thread pointer cannot be used as an operand for inline asm
32-
--> $DIR/bad-reg.rs:41:18
32+
--> $DIR/bad-reg.rs:44:18
3333
|
3434
LL | asm!("", out("tp") _);
3535
| ^^^^^^^^^^^
3636

3737
error: invalid register `zero`: the zero register cannot be used as an operand for inline asm
38-
--> $DIR/bad-reg.rs:43:18
38+
--> $DIR/bad-reg.rs:46:18
3939
|
4040
LL | asm!("", out("zero") _);
4141
| ^^^^^^^^^^^^^
4242

4343
error: register class `vreg` can only be used as a clobber, not as an input or output
44-
--> $DIR/bad-reg.rs:94:18
44+
--> $DIR/bad-reg.rs:97:18
4545
|
4646
LL | asm!("", in("v0") x);
4747
| ^^^^^^^^^^
4848

4949
error: register class `vreg` can only be used as a clobber, not as an input or output
50-
--> $DIR/bad-reg.rs:97:18
50+
--> $DIR/bad-reg.rs:100:18
5151
|
5252
LL | asm!("", out("v0") x);
5353
| ^^^^^^^^^^^
5454

5555
error: register class `vreg` can only be used as a clobber, not as an input or output
56-
--> $DIR/bad-reg.rs:100:26
56+
--> $DIR/bad-reg.rs:103:26
5757
|
5858
LL | asm!("/* {} */", in(vreg) x);
5959
| ^^^^^^^^^^
6060

6161
error: register class `vreg` can only be used as a clobber, not as an input or output
62-
--> $DIR/bad-reg.rs:103:26
62+
--> $DIR/bad-reg.rs:106:26
6363
|
6464
LL | asm!("/* {} */", out(vreg) _);
6565
| ^^^^^^^^^^^
6666

6767
error: type `i32` cannot be used with this register class
68-
--> $DIR/bad-reg.rs:94:27
68+
--> $DIR/bad-reg.rs:97:27
6969
|
7070
LL | asm!("", in("v0") x);
7171
| ^
7272
|
7373
= note: register class `vreg` supports these types:
7474

7575
error: type `i32` cannot be used with this register class
76-
--> $DIR/bad-reg.rs:97:28
76+
--> $DIR/bad-reg.rs:100:28
7777
|
7878
LL | asm!("", out("v0") x);
7979
| ^
8080
|
8181
= note: register class `vreg` supports these types:
8282

8383
error: type `i32` cannot be used with this register class
84-
--> $DIR/bad-reg.rs:100:35
84+
--> $DIR/bad-reg.rs:103:35
8585
|
8686
LL | asm!("/* {} */", in(vreg) x);
8787
| ^

‎tests/ui/asm/riscv/bad-reg.riscv32i.stderr

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,111 +1,111 @@
11
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:31:18
2+
--> $DIR/bad-reg.rs:34:18
33
|
44
LL | asm!("", out("s1") _);
55
| ^^^^^^^^^^^
66

77
error: invalid register `fp`: the frame pointer cannot be used as an operand for inline asm
8-
--> $DIR/bad-reg.rs:33:18
8+
--> $DIR/bad-reg.rs:36:18
99
|
1010
LL | asm!("", out("fp") _);
1111
| ^^^^^^^^^^^
1212

1313
error: invalid register `sp`: the stack pointer cannot be used as an operand for inline asm
14-
--> $DIR/bad-reg.rs:35:18
14+
--> $DIR/bad-reg.rs:38:18
1515
|
1616
LL | asm!("", out("sp") _);
1717
| ^^^^^^^^^^^
1818

1919
error: invalid register `gp`: the global pointer cannot be used as an operand for inline asm
20-
--> $DIR/bad-reg.rs:37:18
20+
--> $DIR/bad-reg.rs:40:18
2121
|
2222
LL | asm!("", out("gp") _);
2323
| ^^^^^^^^^^^
2424

2525
error: invalid register `gp`: the global pointer cannot be used as an operand for inline asm
26-
--> $DIR/bad-reg.rs:39:18
26+
--> $DIR/bad-reg.rs:42:18
2727
|
2828
LL | asm!("", out("gp") _);
2929
| ^^^^^^^^^^^
3030

3131
error: invalid register `tp`: the thread pointer cannot be used as an operand for inline asm
32-
--> $DIR/bad-reg.rs:41:18
32+
--> $DIR/bad-reg.rs:44:18
3333
|
3434
LL | asm!("", out("tp") _);
3535
| ^^^^^^^^^^^
3636

3737
error: invalid register `zero`: the zero register cannot be used as an operand for inline asm
38-
--> $DIR/bad-reg.rs:43:18
38+
--> $DIR/bad-reg.rs:46:18
3939
|
4040
LL | asm!("", out("zero") _);
4141
| ^^^^^^^^^^^^^
4242

4343
error: register class `vreg` can only be used as a clobber, not as an input or output
44-
--> $DIR/bad-reg.rs:94:18
44+
--> $DIR/bad-reg.rs:97:18
4545
|
4646
LL | asm!("", in("v0") x);
4747
| ^^^^^^^^^^
4848

4949
error: register class `vreg` can only be used as a clobber, not as an input or output
50-
--> $DIR/bad-reg.rs:97:18
50+
--> $DIR/bad-reg.rs:100:18
5151
|
5252
LL | asm!("", out("v0") x);
5353
| ^^^^^^^^^^^
5454

5555
error: register class `vreg` can only be used as a clobber, not as an input or output
56-
--> $DIR/bad-reg.rs:100:26
56+
--> $DIR/bad-reg.rs:103:26
5757
|
5858
LL | asm!("/* {} */", in(vreg) x);
5959
| ^^^^^^^^^^
6060

6161
error: register class `vreg` can only be used as a clobber, not as an input or output
62-
--> $DIR/bad-reg.rs:103:26
62+
--> $DIR/bad-reg.rs:106:26
6363
|
6464
LL | asm!("/* {} */", out(vreg) _);
6565
| ^^^^^^^^^^^
6666

6767
error: register class `freg` requires at least one of the following target features: d, f
68-
--> $DIR/bad-reg.rs:80:26
68+
--> $DIR/bad-reg.rs:83:26
6969
|
7070
LL | asm!("/* {} */", in(freg) f);
7171
| ^^^^^^^^^^
7272

7373
error: register class `freg` requires at least one of the following target features: d, f
74-
--> $DIR/bad-reg.rs:82:26
74+
--> $DIR/bad-reg.rs:85:26
7575
|
7676
LL | asm!("/* {} */", out(freg) _);
7777
| ^^^^^^^^^^^
7878

7979
error: register class `freg` requires at least one of the following target features: d, f
80-
--> $DIR/bad-reg.rs:84:26
80+
--> $DIR/bad-reg.rs:87:26
8181
|
8282
LL | asm!("/* {} */", in(freg) d);
8383
| ^^^^^^^^^^
8484

8585
error: register class `freg` requires at least one of the following target features: d, f
86-
--> $DIR/bad-reg.rs:87:26
86+
--> $DIR/bad-reg.rs:90:26
8787
|
8888
LL | asm!("/* {} */", out(freg) d);
8989
| ^^^^^^^^^^^
9090

9191
error: type `i32` cannot be used with this register class
92-
--> $DIR/bad-reg.rs:94:27
92+
--> $DIR/bad-reg.rs:97:27
9393
|
9494
LL | asm!("", in("v0") x);
9595
| ^
9696
|
9797
= note: register class `vreg` supports these types:
9898

9999
error: type `i32` cannot be used with this register class
100-
--> $DIR/bad-reg.rs:97:28
100+
--> $DIR/bad-reg.rs:100:28
101101
|
102102
LL | asm!("", out("v0") x);
103103
| ^
104104
|
105105
= note: register class `vreg` supports these types:
106106

107107
error: type `i32` cannot be used with this register class
108-
--> $DIR/bad-reg.rs:100:35
108+
--> $DIR/bad-reg.rs:103:35
109109
|
110110
LL | asm!("/* {} */", in(vreg) x);
111111
| ^

‎tests/ui/asm/riscv/bad-reg.riscv32imafc.stderr

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,103 +1,103 @@
11
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:31:18
2+
--> $DIR/bad-reg.rs:34:18
33
|
44
LL | asm!("", out("s1") _);
55
| ^^^^^^^^^^^
66

77
error: invalid register `fp`: the frame pointer cannot be used as an operand for inline asm
8-
--> $DIR/bad-reg.rs:33:18
8+
--> $DIR/bad-reg.rs:36:18
99
|
1010
LL | asm!("", out("fp") _);
1111
| ^^^^^^^^^^^
1212

1313
error: invalid register `sp`: the stack pointer cannot be used as an operand for inline asm
14-
--> $DIR/bad-reg.rs:35:18
14+
--> $DIR/bad-reg.rs:38:18
1515
|
1616
LL | asm!("", out("sp") _);
1717
| ^^^^^^^^^^^
1818

1919
error: invalid register `gp`: the global pointer cannot be used as an operand for inline asm
20-
--> $DIR/bad-reg.rs:37:18
20+
--> $DIR/bad-reg.rs:40:18
2121
|
2222
LL | asm!("", out("gp") _);
2323
| ^^^^^^^^^^^
2424

2525
error: invalid register `gp`: the global pointer cannot be used as an operand for inline asm
26-
--> $DIR/bad-reg.rs:39:18
26+
--> $DIR/bad-reg.rs:42:18
2727
|
2828
LL | asm!("", out("gp") _);
2929
| ^^^^^^^^^^^
3030

3131
error: invalid register `tp`: the thread pointer cannot be used as an operand for inline asm
32-
--> $DIR/bad-reg.rs:41:18
32+
--> $DIR/bad-reg.rs:44:18
3333
|
3434
LL | asm!("", out("tp") _);
3535
| ^^^^^^^^^^^
3636

3737
error: invalid register `zero`: the zero register cannot be used as an operand for inline asm
38-
--> $DIR/bad-reg.rs:43:18
38+
--> $DIR/bad-reg.rs:46:18
3939
|
4040
LL | asm!("", out("zero") _);
4141
| ^^^^^^^^^^^^^
4242

4343
error: register class `vreg` can only be used as a clobber, not as an input or output
44-
--> $DIR/bad-reg.rs:94:18
44+
--> $DIR/bad-reg.rs:97:18
4545
|
4646
LL | asm!("", in("v0") x);
4747
| ^^^^^^^^^^
4848

4949
error: register class `vreg` can only be used as a clobber, not as an input or output
50-
--> $DIR/bad-reg.rs:97:18
50+
--> $DIR/bad-reg.rs:100:18
5151
|
5252
LL | asm!("", out("v0") x);
5353
| ^^^^^^^^^^^
5454

5555
error: register class `vreg` can only be used as a clobber, not as an input or output
56-
--> $DIR/bad-reg.rs:100:26
56+
--> $DIR/bad-reg.rs:103:26
5757
|
5858
LL | asm!("/* {} */", in(vreg) x);
5959
| ^^^^^^^^^^
6060

6161
error: register class `vreg` can only be used as a clobber, not as an input or output
62-
--> $DIR/bad-reg.rs:103:26
62+
--> $DIR/bad-reg.rs:106:26
6363
|
6464
LL | asm!("/* {} */", out(vreg) _);
6565
| ^^^^^^^^^^^
6666

6767
error: `d` target feature is not enabled
68-
--> $DIR/bad-reg.rs:84:35
68+
--> $DIR/bad-reg.rs:87:35
6969
|
7070
LL | asm!("/* {} */", in(freg) d);
7171
| ^
7272
|
7373
= note: this is required to use type `f64` with register class `freg`
7474

7575
error: `d` target feature is not enabled
76-
--> $DIR/bad-reg.rs:87:36
76+
--> $DIR/bad-reg.rs:90:36
7777
|
7878
LL | asm!("/* {} */", out(freg) d);
7979
| ^
8080
|
8181
= note: this is required to use type `f64` with register class `freg`
8282

8383
error: type `i32` cannot be used with this register class
84-
--> $DIR/bad-reg.rs:94:27
84+
--> $DIR/bad-reg.rs:97:27
8585
|
8686
LL | asm!("", in("v0") x);
8787
| ^
8888
|
8989
= note: register class `vreg` supports these types:
9090

9191
error: type `i32` cannot be used with this register class
92-
--> $DIR/bad-reg.rs:97:28
92+
--> $DIR/bad-reg.rs:100:28
9393
|
9494
LL | asm!("", out("v0") x);
9595
| ^
9696
|
9797
= note: register class `vreg` supports these types:
9898

9999
error: type `i32` cannot be used with this register class
100-
--> $DIR/bad-reg.rs:100:35
100+
--> $DIR/bad-reg.rs:103:35
101101
|
102102
LL | asm!("/* {} */", in(vreg) x);
103103
| ^

‎tests/ui/asm/riscv/bad-reg.riscv64gc.stderr

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,87 +1,87 @@
11
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:31:18
2+
--> $DIR/bad-reg.rs:34:18
33
|
44
LL | asm!("", out("s1") _);
55
| ^^^^^^^^^^^
66

77
error: invalid register `fp`: the frame pointer cannot be used as an operand for inline asm
8-
--> $DIR/bad-reg.rs:33:18
8+
--> $DIR/bad-reg.rs:36:18
99
|
1010
LL | asm!("", out("fp") _);
1111
| ^^^^^^^^^^^
1212

1313
error: invalid register `sp`: the stack pointer cannot be used as an operand for inline asm
14-
--> $DIR/bad-reg.rs:35:18
14+
--> $DIR/bad-reg.rs:38:18
1515
|
1616
LL | asm!("", out("sp") _);
1717
| ^^^^^^^^^^^
1818

1919
error: invalid register `gp`: the global pointer cannot be used as an operand for inline asm
20-
--> $DIR/bad-reg.rs:37:18
20+
--> $DIR/bad-reg.rs:40:18
2121
|
2222
LL | asm!("", out("gp") _);
2323
| ^^^^^^^^^^^
2424

2525
error: invalid register `gp`: the global pointer cannot be used as an operand for inline asm
26-
--> $DIR/bad-reg.rs:39:18
26+
--> $DIR/bad-reg.rs:42:18
2727
|
2828
LL | asm!("", out("gp") _);
2929
| ^^^^^^^^^^^
3030

3131
error: invalid register `tp`: the thread pointer cannot be used as an operand for inline asm
32-
--> $DIR/bad-reg.rs:41:18
32+
--> $DIR/bad-reg.rs:44:18
3333
|
3434
LL | asm!("", out("tp") _);
3535
| ^^^^^^^^^^^
3636

3737
error: invalid register `zero`: the zero register cannot be used as an operand for inline asm
38-
--> $DIR/bad-reg.rs:43:18
38+
--> $DIR/bad-reg.rs:46:18
3939
|
4040
LL | asm!("", out("zero") _);
4141
| ^^^^^^^^^^^^^
4242

4343
error: register class `vreg` can only be used as a clobber, not as an input or output
44-
--> $DIR/bad-reg.rs:94:18
44+
--> $DIR/bad-reg.rs:97:18
4545
|
4646
LL | asm!("", in("v0") x);
4747
| ^^^^^^^^^^
4848

4949
error: register class `vreg` can only be used as a clobber, not as an input or output
50-
--> $DIR/bad-reg.rs:97:18
50+
--> $DIR/bad-reg.rs:100:18
5151
|
5252
LL | asm!("", out("v0") x);
5353
| ^^^^^^^^^^^
5454

5555
error: register class `vreg` can only be used as a clobber, not as an input or output
56-
--> $DIR/bad-reg.rs:100:26
56+
--> $DIR/bad-reg.rs:103:26
5757
|
5858
LL | asm!("/* {} */", in(vreg) x);
5959
| ^^^^^^^^^^
6060

6161
error: register class `vreg` can only be used as a clobber, not as an input or output
62-
--> $DIR/bad-reg.rs:103:26
62+
--> $DIR/bad-reg.rs:106:26
6363
|
6464
LL | asm!("/* {} */", out(vreg) _);
6565
| ^^^^^^^^^^^
6666

6767
error: type `i32` cannot be used with this register class
68-
--> $DIR/bad-reg.rs:94:27
68+
--> $DIR/bad-reg.rs:97:27
6969
|
7070
LL | asm!("", in("v0") x);
7171
| ^
7272
|
7373
= note: register class `vreg` supports these types:
7474

7575
error: type `i32` cannot be used with this register class
76-
--> $DIR/bad-reg.rs:97:28
76+
--> $DIR/bad-reg.rs:100:28
7777
|
7878
LL | asm!("", out("v0") x);
7979
| ^
8080
|
8181
= note: register class `vreg` supports these types:
8282

8383
error: type `i32` cannot be used with this register class
84-
--> $DIR/bad-reg.rs:100:35
84+
--> $DIR/bad-reg.rs:103:35
8585
|
8686
LL | asm!("/* {} */", in(vreg) x);
8787
| ^

‎tests/ui/asm/riscv/bad-reg.riscv64imac.stderr

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,111 +1,111 @@
11
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:31:18
2+
--> $DIR/bad-reg.rs:34:18
33
|
44
LL | asm!("", out("s1") _);
55
| ^^^^^^^^^^^
66

77
error: invalid register `fp`: the frame pointer cannot be used as an operand for inline asm
8-
--> $DIR/bad-reg.rs:33:18
8+
--> $DIR/bad-reg.rs:36:18
99
|
1010
LL | asm!("", out("fp") _);
1111
| ^^^^^^^^^^^
1212

1313
error: invalid register `sp`: the stack pointer cannot be used as an operand for inline asm
14-
--> $DIR/bad-reg.rs:35:18
14+
--> $DIR/bad-reg.rs:38:18
1515
|
1616
LL | asm!("", out("sp") _);
1717
| ^^^^^^^^^^^
1818

1919
error: invalid register `gp`: the global pointer cannot be used as an operand for inline asm
20-
--> $DIR/bad-reg.rs:37:18
20+
--> $DIR/bad-reg.rs:40:18
2121
|
2222
LL | asm!("", out("gp") _);
2323
| ^^^^^^^^^^^
2424

2525
error: invalid register `gp`: the global pointer cannot be used as an operand for inline asm
26-
--> $DIR/bad-reg.rs:39:18
26+
--> $DIR/bad-reg.rs:42:18
2727
|
2828
LL | asm!("", out("gp") _);
2929
| ^^^^^^^^^^^
3030

3131
error: invalid register `tp`: the thread pointer cannot be used as an operand for inline asm
32-
--> $DIR/bad-reg.rs:41:18
32+
--> $DIR/bad-reg.rs:44:18
3333
|
3434
LL | asm!("", out("tp") _);
3535
| ^^^^^^^^^^^
3636

3737
error: invalid register `zero`: the zero register cannot be used as an operand for inline asm
38-
--> $DIR/bad-reg.rs:43:18
38+
--> $DIR/bad-reg.rs:46:18
3939
|
4040
LL | asm!("", out("zero") _);
4141
| ^^^^^^^^^^^^^
4242

4343
error: register class `vreg` can only be used as a clobber, not as an input or output
44-
--> $DIR/bad-reg.rs:94:18
44+
--> $DIR/bad-reg.rs:97:18
4545
|
4646
LL | asm!("", in("v0") x);
4747
| ^^^^^^^^^^
4848

4949
error: register class `vreg` can only be used as a clobber, not as an input or output
50-
--> $DIR/bad-reg.rs:97:18
50+
--> $DIR/bad-reg.rs:100:18
5151
|
5252
LL | asm!("", out("v0") x);
5353
| ^^^^^^^^^^^
5454

5555
error: register class `vreg` can only be used as a clobber, not as an input or output
56-
--> $DIR/bad-reg.rs:100:26
56+
--> $DIR/bad-reg.rs:103:26
5757
|
5858
LL | asm!("/* {} */", in(vreg) x);
5959
| ^^^^^^^^^^
6060

6161
error: register class `vreg` can only be used as a clobber, not as an input or output
62-
--> $DIR/bad-reg.rs:103:26
62+
--> $DIR/bad-reg.rs:106:26
6363
|
6464
LL | asm!("/* {} */", out(vreg) _);
6565
| ^^^^^^^^^^^
6666

6767
error: register class `freg` requires at least one of the following target features: d, f
68-
--> $DIR/bad-reg.rs:80:26
68+
--> $DIR/bad-reg.rs:83:26
6969
|
7070
LL | asm!("/* {} */", in(freg) f);
7171
| ^^^^^^^^^^
7272

7373
error: register class `freg` requires at least one of the following target features: d, f
74-
--> $DIR/bad-reg.rs:82:26
74+
--> $DIR/bad-reg.rs:85:26
7575
|
7676
LL | asm!("/* {} */", out(freg) _);
7777
| ^^^^^^^^^^^
7878

7979
error: register class `freg` requires at least one of the following target features: d, f
80-
--> $DIR/bad-reg.rs:84:26
80+
--> $DIR/bad-reg.rs:87:26
8181
|
8282
LL | asm!("/* {} */", in(freg) d);
8383
| ^^^^^^^^^^
8484

8585
error: register class `freg` requires at least one of the following target features: d, f
86-
--> $DIR/bad-reg.rs:87:26
86+
--> $DIR/bad-reg.rs:90:26
8787
|
8888
LL | asm!("/* {} */", out(freg) d);
8989
| ^^^^^^^^^^^
9090

9191
error: type `i32` cannot be used with this register class
92-
--> $DIR/bad-reg.rs:94:27
92+
--> $DIR/bad-reg.rs:97:27
9393
|
9494
LL | asm!("", in("v0") x);
9595
| ^
9696
|
9797
= note: register class `vreg` supports these types:
9898

9999
error: type `i32` cannot be used with this register class
100-
--> $DIR/bad-reg.rs:97:28
100+
--> $DIR/bad-reg.rs:100:28
101101
|
102102
LL | asm!("", out("v0") x);
103103
| ^
104104
|
105105
= note: register class `vreg` supports these types:
106106

107107
error: type `i32` cannot be used with this register class
108-
--> $DIR/bad-reg.rs:100:35
108+
--> $DIR/bad-reg.rs:103:35
109109
|
110110
LL | asm!("/* {} */", in(vreg) x);
111111
| ^

‎tests/ui/asm/riscv/bad-reg.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
//@[riscv64gc] compile-flags: --target riscv64gc-unknown-linux-gnu
1515
//@[riscv64gc] needs-llvm-components: riscv
1616

17+
// Unlike riscv32e-registers.rs, this tests if the rustc can reject invalid registers
18+
// usage in the asm! API (in, out, inout, etc.).
19+
1720
#![crate_type = "lib"]
1821
#![feature(no_core, rustc_attrs)]
1922
#![feature(asm_experimental_arch)]

‎tests/ui/abi/riscv32e-registers.riscv32e.stderr renamed to ‎tests/ui/asm/riscv/riscv32e-registers.riscv32e.stderr

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: invalid operand for instruction
2-
--> $DIR/riscv32e-registers.rs:43:11
2+
--> $DIR/riscv32e-registers.rs:46:11
33
|
44
LL | asm!("li x16, 0");
55
| ^
@@ -11,7 +11,7 @@ LL | li x16, 0
1111
| ^
1212

1313
error: invalid operand for instruction
14-
--> $DIR/riscv32e-registers.rs:46:11
14+
--> $DIR/riscv32e-registers.rs:49:11
1515
|
1616
LL | asm!("li x17, 0");
1717
| ^
@@ -23,7 +23,7 @@ LL | li x17, 0
2323
| ^
2424

2525
error: invalid operand for instruction
26-
--> $DIR/riscv32e-registers.rs:49:11
26+
--> $DIR/riscv32e-registers.rs:52:11
2727
|
2828
LL | asm!("li x18, 0");
2929
| ^
@@ -35,7 +35,7 @@ LL | li x18, 0
3535
| ^
3636

3737
error: invalid operand for instruction
38-
--> $DIR/riscv32e-registers.rs:52:11
38+
--> $DIR/riscv32e-registers.rs:55:11
3939
|
4040
LL | asm!("li x19, 0");
4141
| ^
@@ -47,7 +47,7 @@ LL | li x19, 0
4747
| ^
4848

4949
error: invalid operand for instruction
50-
--> $DIR/riscv32e-registers.rs:55:11
50+
--> $DIR/riscv32e-registers.rs:58:11
5151
|
5252
LL | asm!("li x20, 0");
5353
| ^
@@ -59,7 +59,7 @@ LL | li x20, 0
5959
| ^
6060

6161
error: invalid operand for instruction
62-
--> $DIR/riscv32e-registers.rs:58:11
62+
--> $DIR/riscv32e-registers.rs:61:11
6363
|
6464
LL | asm!("li x21, 0");
6565
| ^
@@ -71,7 +71,7 @@ LL | li x21, 0
7171
| ^
7272

7373
error: invalid operand for instruction
74-
--> $DIR/riscv32e-registers.rs:61:11
74+
--> $DIR/riscv32e-registers.rs:64:11
7575
|
7676
LL | asm!("li x22, 0");
7777
| ^
@@ -83,7 +83,7 @@ LL | li x22, 0
8383
| ^
8484

8585
error: invalid operand for instruction
86-
--> $DIR/riscv32e-registers.rs:64:11
86+
--> $DIR/riscv32e-registers.rs:67:11
8787
|
8888
LL | asm!("li x23, 0");
8989
| ^
@@ -95,7 +95,7 @@ LL | li x23, 0
9595
| ^
9696

9797
error: invalid operand for instruction
98-
--> $DIR/riscv32e-registers.rs:67:11
98+
--> $DIR/riscv32e-registers.rs:70:11
9999
|
100100
LL | asm!("li x24, 0");
101101
| ^
@@ -107,7 +107,7 @@ LL | li x24, 0
107107
| ^
108108

109109
error: invalid operand for instruction
110-
--> $DIR/riscv32e-registers.rs:70:11
110+
--> $DIR/riscv32e-registers.rs:73:11
111111
|
112112
LL | asm!("li x25, 0");
113113
| ^
@@ -119,7 +119,7 @@ LL | li x25, 0
119119
| ^
120120

121121
error: invalid operand for instruction
122-
--> $DIR/riscv32e-registers.rs:73:11
122+
--> $DIR/riscv32e-registers.rs:76:11
123123
|
124124
LL | asm!("li x26, 0");
125125
| ^
@@ -131,7 +131,7 @@ LL | li x26, 0
131131
| ^
132132

133133
error: invalid operand for instruction
134-
--> $DIR/riscv32e-registers.rs:76:11
134+
--> $DIR/riscv32e-registers.rs:79:11
135135
|
136136
LL | asm!("li x27, 0");
137137
| ^
@@ -143,7 +143,7 @@ LL | li x27, 0
143143
| ^
144144

145145
error: invalid operand for instruction
146-
--> $DIR/riscv32e-registers.rs:79:11
146+
--> $DIR/riscv32e-registers.rs:82:11
147147
|
148148
LL | asm!("li x28, 0");
149149
| ^
@@ -155,7 +155,7 @@ LL | li x28, 0
155155
| ^
156156

157157
error: invalid operand for instruction
158-
--> $DIR/riscv32e-registers.rs:82:11
158+
--> $DIR/riscv32e-registers.rs:85:11
159159
|
160160
LL | asm!("li x29, 0");
161161
| ^
@@ -167,7 +167,7 @@ LL | li x29, 0
167167
| ^
168168

169169
error: invalid operand for instruction
170-
--> $DIR/riscv32e-registers.rs:85:11
170+
--> $DIR/riscv32e-registers.rs:88:11
171171
|
172172
LL | asm!("li x30, 0");
173173
| ^
@@ -179,7 +179,7 @@ LL | li x30, 0
179179
| ^
180180

181181
error: invalid operand for instruction
182-
--> $DIR/riscv32e-registers.rs:88:11
182+
--> $DIR/riscv32e-registers.rs:91:11
183183
|
184184
LL | asm!("li x31, 0");
185185
| ^

‎tests/ui/abi/riscv32e-registers.riscv32em.stderr renamed to ‎tests/ui/asm/riscv/riscv32e-registers.riscv32em.stderr

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: invalid operand for instruction
2-
--> $DIR/riscv32e-registers.rs:43:11
2+
--> $DIR/riscv32e-registers.rs:46:11
33
|
44
LL | asm!("li x16, 0");
55
| ^
@@ -11,7 +11,7 @@ LL | li x16, 0
1111
| ^
1212

1313
error: invalid operand for instruction
14-
--> $DIR/riscv32e-registers.rs:46:11
14+
--> $DIR/riscv32e-registers.rs:49:11
1515
|
1616
LL | asm!("li x17, 0");
1717
| ^
@@ -23,7 +23,7 @@ LL | li x17, 0
2323
| ^
2424

2525
error: invalid operand for instruction
26-
--> $DIR/riscv32e-registers.rs:49:11
26+
--> $DIR/riscv32e-registers.rs:52:11
2727
|
2828
LL | asm!("li x18, 0");
2929
| ^
@@ -35,7 +35,7 @@ LL | li x18, 0
3535
| ^
3636

3737
error: invalid operand for instruction
38-
--> $DIR/riscv32e-registers.rs:52:11
38+
--> $DIR/riscv32e-registers.rs:55:11
3939
|
4040
LL | asm!("li x19, 0");
4141
| ^
@@ -47,7 +47,7 @@ LL | li x19, 0
4747
| ^
4848

4949
error: invalid operand for instruction
50-
--> $DIR/riscv32e-registers.rs:55:11
50+
--> $DIR/riscv32e-registers.rs:58:11
5151
|
5252
LL | asm!("li x20, 0");
5353
| ^
@@ -59,7 +59,7 @@ LL | li x20, 0
5959
| ^
6060

6161
error: invalid operand for instruction
62-
--> $DIR/riscv32e-registers.rs:58:11
62+
--> $DIR/riscv32e-registers.rs:61:11
6363
|
6464
LL | asm!("li x21, 0");
6565
| ^
@@ -71,7 +71,7 @@ LL | li x21, 0
7171
| ^
7272

7373
error: invalid operand for instruction
74-
--> $DIR/riscv32e-registers.rs:61:11
74+
--> $DIR/riscv32e-registers.rs:64:11
7575
|
7676
LL | asm!("li x22, 0");
7777
| ^
@@ -83,7 +83,7 @@ LL | li x22, 0
8383
| ^
8484

8585
error: invalid operand for instruction
86-
--> $DIR/riscv32e-registers.rs:64:11
86+
--> $DIR/riscv32e-registers.rs:67:11
8787
|
8888
LL | asm!("li x23, 0");
8989
| ^
@@ -95,7 +95,7 @@ LL | li x23, 0
9595
| ^
9696

9797
error: invalid operand for instruction
98-
--> $DIR/riscv32e-registers.rs:67:11
98+
--> $DIR/riscv32e-registers.rs:70:11
9999
|
100100
LL | asm!("li x24, 0");
101101
| ^
@@ -107,7 +107,7 @@ LL | li x24, 0
107107
| ^
108108

109109
error: invalid operand for instruction
110-
--> $DIR/riscv32e-registers.rs:70:11
110+
--> $DIR/riscv32e-registers.rs:73:11
111111
|
112112
LL | asm!("li x25, 0");
113113
| ^
@@ -119,7 +119,7 @@ LL | li x25, 0
119119
| ^
120120

121121
error: invalid operand for instruction
122-
--> $DIR/riscv32e-registers.rs:73:11
122+
--> $DIR/riscv32e-registers.rs:76:11
123123
|
124124
LL | asm!("li x26, 0");
125125
| ^
@@ -131,7 +131,7 @@ LL | li x26, 0
131131
| ^
132132

133133
error: invalid operand for instruction
134-
--> $DIR/riscv32e-registers.rs:76:11
134+
--> $DIR/riscv32e-registers.rs:79:11
135135
|
136136
LL | asm!("li x27, 0");
137137
| ^
@@ -143,7 +143,7 @@ LL | li x27, 0
143143
| ^
144144

145145
error: invalid operand for instruction
146-
--> $DIR/riscv32e-registers.rs:79:11
146+
--> $DIR/riscv32e-registers.rs:82:11
147147
|
148148
LL | asm!("li x28, 0");
149149
| ^
@@ -155,7 +155,7 @@ LL | li x28, 0
155155
| ^
156156

157157
error: invalid operand for instruction
158-
--> $DIR/riscv32e-registers.rs:82:11
158+
--> $DIR/riscv32e-registers.rs:85:11
159159
|
160160
LL | asm!("li x29, 0");
161161
| ^
@@ -167,7 +167,7 @@ LL | li x29, 0
167167
| ^
168168

169169
error: invalid operand for instruction
170-
--> $DIR/riscv32e-registers.rs:85:11
170+
--> $DIR/riscv32e-registers.rs:88:11
171171
|
172172
LL | asm!("li x30, 0");
173173
| ^
@@ -179,7 +179,7 @@ LL | li x30, 0
179179
| ^
180180

181181
error: invalid operand for instruction
182-
--> $DIR/riscv32e-registers.rs:88:11
182+
--> $DIR/riscv32e-registers.rs:91:11
183183
|
184184
LL | asm!("li x31, 0");
185185
| ^

‎tests/ui/abi/riscv32e-registers.riscv32emc.stderr renamed to ‎tests/ui/asm/riscv/riscv32e-registers.riscv32emc.stderr

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: invalid operand for instruction
2-
--> $DIR/riscv32e-registers.rs:43:11
2+
--> $DIR/riscv32e-registers.rs:46:11
33
|
44
LL | asm!("li x16, 0");
55
| ^
@@ -11,7 +11,7 @@ LL | li x16, 0
1111
| ^
1212

1313
error: invalid operand for instruction
14-
--> $DIR/riscv32e-registers.rs:46:11
14+
--> $DIR/riscv32e-registers.rs:49:11
1515
|
1616
LL | asm!("li x17, 0");
1717
| ^
@@ -23,7 +23,7 @@ LL | li x17, 0
2323
| ^
2424

2525
error: invalid operand for instruction
26-
--> $DIR/riscv32e-registers.rs:49:11
26+
--> $DIR/riscv32e-registers.rs:52:11
2727
|
2828
LL | asm!("li x18, 0");
2929
| ^
@@ -35,7 +35,7 @@ LL | li x18, 0
3535
| ^
3636

3737
error: invalid operand for instruction
38-
--> $DIR/riscv32e-registers.rs:52:11
38+
--> $DIR/riscv32e-registers.rs:55:11
3939
|
4040
LL | asm!("li x19, 0");
4141
| ^
@@ -47,7 +47,7 @@ LL | li x19, 0
4747
| ^
4848

4949
error: invalid operand for instruction
50-
--> $DIR/riscv32e-registers.rs:55:11
50+
--> $DIR/riscv32e-registers.rs:58:11
5151
|
5252
LL | asm!("li x20, 0");
5353
| ^
@@ -59,7 +59,7 @@ LL | li x20, 0
5959
| ^
6060

6161
error: invalid operand for instruction
62-
--> $DIR/riscv32e-registers.rs:58:11
62+
--> $DIR/riscv32e-registers.rs:61:11
6363
|
6464
LL | asm!("li x21, 0");
6565
| ^
@@ -71,7 +71,7 @@ LL | li x21, 0
7171
| ^
7272

7373
error: invalid operand for instruction
74-
--> $DIR/riscv32e-registers.rs:61:11
74+
--> $DIR/riscv32e-registers.rs:64:11
7575
|
7676
LL | asm!("li x22, 0");
7777
| ^
@@ -83,7 +83,7 @@ LL | li x22, 0
8383
| ^
8484

8585
error: invalid operand for instruction
86-
--> $DIR/riscv32e-registers.rs:64:11
86+
--> $DIR/riscv32e-registers.rs:67:11
8787
|
8888
LL | asm!("li x23, 0");
8989
| ^
@@ -95,7 +95,7 @@ LL | li x23, 0
9595
| ^
9696

9797
error: invalid operand for instruction
98-
--> $DIR/riscv32e-registers.rs:67:11
98+
--> $DIR/riscv32e-registers.rs:70:11
9999
|
100100
LL | asm!("li x24, 0");
101101
| ^
@@ -107,7 +107,7 @@ LL | li x24, 0
107107
| ^
108108

109109
error: invalid operand for instruction
110-
--> $DIR/riscv32e-registers.rs:70:11
110+
--> $DIR/riscv32e-registers.rs:73:11
111111
|
112112
LL | asm!("li x25, 0");
113113
| ^
@@ -119,7 +119,7 @@ LL | li x25, 0
119119
| ^
120120

121121
error: invalid operand for instruction
122-
--> $DIR/riscv32e-registers.rs:73:11
122+
--> $DIR/riscv32e-registers.rs:76:11
123123
|
124124
LL | asm!("li x26, 0");
125125
| ^
@@ -131,7 +131,7 @@ LL | li x26, 0
131131
| ^
132132

133133
error: invalid operand for instruction
134-
--> $DIR/riscv32e-registers.rs:76:11
134+
--> $DIR/riscv32e-registers.rs:79:11
135135
|
136136
LL | asm!("li x27, 0");
137137
| ^
@@ -143,7 +143,7 @@ LL | li x27, 0
143143
| ^
144144

145145
error: invalid operand for instruction
146-
--> $DIR/riscv32e-registers.rs:79:11
146+
--> $DIR/riscv32e-registers.rs:82:11
147147
|
148148
LL | asm!("li x28, 0");
149149
| ^
@@ -155,7 +155,7 @@ LL | li x28, 0
155155
| ^
156156

157157
error: invalid operand for instruction
158-
--> $DIR/riscv32e-registers.rs:82:11
158+
--> $DIR/riscv32e-registers.rs:85:11
159159
|
160160
LL | asm!("li x29, 0");
161161
| ^
@@ -167,7 +167,7 @@ LL | li x29, 0
167167
| ^
168168

169169
error: invalid operand for instruction
170-
--> $DIR/riscv32e-registers.rs:85:11
170+
--> $DIR/riscv32e-registers.rs:88:11
171171
|
172172
LL | asm!("li x30, 0");
173173
| ^
@@ -179,7 +179,7 @@ LL | li x30, 0
179179
| ^
180180

181181
error: invalid operand for instruction
182-
--> $DIR/riscv32e-registers.rs:88:11
182+
--> $DIR/riscv32e-registers.rs:91:11
183183
|
184184
LL | asm!("li x31, 0");
185185
| ^

‎tests/ui/abi/riscv32e-registers.rs renamed to ‎tests/ui/asm/riscv/riscv32e-registers.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
//@ [riscv32emc] needs-llvm-components: riscv
1212
//@ [riscv32emc] compile-flags: --target=riscv32emc-unknown-none-elf
1313

14+
// Unlike bad-reg.rs, this tests if the assembler can reject invalid registers
15+
// usage in assembly code.
16+
1417
#![no_core]
1518
#![feature(no_core, lang_items, rustc_attrs)]
1619

0 commit comments

Comments
 (0)
Please sign in to comment.