Skip to content

Commit 27213b0

Browse files
committed
Disable some tests for platforms without registers.
Update new tests to run on aarch64 platforms.
1 parent 6d218d0 commit 27213b0

17 files changed

+296
-188
lines changed

Diff for: src/test/ui/asm/aarch64/parse-error.rs

+6
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,12 @@ fn main() {
7676
//~^ ERROR asm template must be a string literal
7777
asm!("{1}", format!("{{{}}}", 0), in(reg) foo, out(reg) bar);
7878
//~^ ERROR asm template must be a string literal
79+
asm!("{}", in(reg) _);
80+
//~^ ERROR _ cannot be used for input operands
81+
asm!("{}", inout(reg) _);
82+
//~^ ERROR _ cannot be used for input operands
83+
asm!("{}", inlateout(reg) _);
84+
//~^ ERROR _ cannot be used for input operands
7985
}
8086
}
8187

Diff for: src/test/ui/asm/aarch64/parse-error.stderr

+43-25
Original file line numberDiff line numberDiff line change
@@ -214,162 +214,180 @@ LL | asm!("{1}", format!("{{{}}}", 0), in(reg) foo, out(reg) bar);
214214
|
215215
= note: this error originates in the macro `format` (in Nightly builds, run with -Z macro-backtrace for more info)
216216

217+
error: _ cannot be used for input operands
218+
--> $DIR/parse-error.rs:79:28
219+
|
220+
LL | asm!("{}", in(reg) _);
221+
| ^
222+
223+
error: _ cannot be used for input operands
224+
--> $DIR/parse-error.rs:81:31
225+
|
226+
LL | asm!("{}", inout(reg) _);
227+
| ^
228+
229+
error: _ cannot be used for input operands
230+
--> $DIR/parse-error.rs:83:35
231+
|
232+
LL | asm!("{}", inlateout(reg) _);
233+
| ^
234+
217235
error: requires at least a template string argument
218-
--> $DIR/parse-error.rs:84:1
236+
--> $DIR/parse-error.rs:90:1
219237
|
220238
LL | global_asm!();
221239
| ^^^^^^^^^^^^^^
222240

223241
error: asm template must be a string literal
224-
--> $DIR/parse-error.rs:86:13
242+
--> $DIR/parse-error.rs:92:13
225243
|
226244
LL | global_asm!(FOO);
227245
| ^^^
228246

229247
error: expected token: `,`
230-
--> $DIR/parse-error.rs:88:18
248+
--> $DIR/parse-error.rs:94:18
231249
|
232250
LL | global_asm!("{}" FOO);
233251
| ^^^ expected `,`
234252

235253
error: expected operand, options, or additional template string
236-
--> $DIR/parse-error.rs:90:19
254+
--> $DIR/parse-error.rs:96:19
237255
|
238256
LL | global_asm!("{}", FOO);
239257
| ^^^ expected operand, options, or additional template string
240258

241259
error: expected expression, found end of macro arguments
242-
--> $DIR/parse-error.rs:92:24
260+
--> $DIR/parse-error.rs:98:24
243261
|
244262
LL | global_asm!("{}", const);
245263
| ^ expected expression
246264

247265
error: expected one of `,`, `.`, `?`, or an operator, found `FOO`
248-
--> $DIR/parse-error.rs:94:30
266+
--> $DIR/parse-error.rs:100:30
249267
|
250268
LL | global_asm!("{}", const(reg) FOO);
251269
| ^^^ expected one of `,`, `.`, `?`, or an operator
252270

253271
error: expected one of `)`, `att_syntax`, or `raw`, found `FOO`
254-
--> $DIR/parse-error.rs:96:25
272+
--> $DIR/parse-error.rs:102:25
255273
|
256274
LL | global_asm!("", options(FOO));
257275
| ^^^ expected one of `)`, `att_syntax`, or `raw`
258276

259277
error: expected one of `)`, `att_syntax`, or `raw`, found `nomem`
260-
--> $DIR/parse-error.rs:98:25
278+
--> $DIR/parse-error.rs:104:25
261279
|
262280
LL | global_asm!("", options(nomem FOO));
263281
| ^^^^^ expected one of `)`, `att_syntax`, or `raw`
264282

265283
error: expected one of `)`, `att_syntax`, or `raw`, found `nomem`
266-
--> $DIR/parse-error.rs:100:25
284+
--> $DIR/parse-error.rs:106:25
267285
|
268286
LL | global_asm!("", options(nomem, FOO));
269287
| ^^^^^ expected one of `)`, `att_syntax`, or `raw`
270288

271289
error: arguments are not allowed after options
272-
--> $DIR/parse-error.rs:102:30
290+
--> $DIR/parse-error.rs:108:30
273291
|
274292
LL | global_asm!("{}", options(), const FOO);
275293
| --------- ^^^^^^^^^ argument
276294
| |
277295
| previous options
278296

279297
error: expected string literal
280-
--> $DIR/parse-error.rs:104:29
298+
--> $DIR/parse-error.rs:110:29
281299
|
282300
LL | global_asm!("", clobber_abi(FOO));
283301
| ^^^ not a string literal
284302

285303
error: expected `)`, found `FOO`
286-
--> $DIR/parse-error.rs:106:33
304+
--> $DIR/parse-error.rs:112:33
287305
|
288306
LL | global_asm!("", clobber_abi("C" FOO));
289307
| ^^^ expected `)`
290308

291309
error: expected `)`, found `,`
292-
--> $DIR/parse-error.rs:108:32
310+
--> $DIR/parse-error.rs:114:32
293311
|
294312
LL | global_asm!("", clobber_abi("C", FOO));
295313
| ^ expected `)`
296314

297315
error: arguments are not allowed after clobber_abi
298-
--> $DIR/parse-error.rs:110:37
316+
--> $DIR/parse-error.rs:116:37
299317
|
300318
LL | global_asm!("{}", clobber_abi("C"), const FOO);
301319
| ---------------- ^^^^^^^^^ argument
302320
| |
303321
| clobber_abi
304322

305323
error: `clobber_abi` cannot be used with `global_asm!`
306-
--> $DIR/parse-error.rs:110:19
324+
--> $DIR/parse-error.rs:116:19
307325
|
308326
LL | global_asm!("{}", clobber_abi("C"), const FOO);
309327
| ^^^^^^^^^^^^^^^^
310328

311329
error: clobber_abi is not allowed after options
312-
--> $DIR/parse-error.rs:113:28
330+
--> $DIR/parse-error.rs:119:28
313331
|
314332
LL | global_asm!("", options(), clobber_abi("C"));
315333
| --------- ^^^^^^^^^^^^^^^^
316334
| |
317335
| options
318336

319337
error: clobber_abi is not allowed after options
320-
--> $DIR/parse-error.rs:115:30
338+
--> $DIR/parse-error.rs:121:30
321339
|
322340
LL | global_asm!("{}", options(), clobber_abi("C"), const FOO);
323341
| --------- ^^^^^^^^^^^^^^^^
324342
| |
325343
| options
326344

327345
error: clobber_abi specified multiple times
328-
--> $DIR/parse-error.rs:117:35
346+
--> $DIR/parse-error.rs:123:35
329347
|
330348
LL | global_asm!("", clobber_abi("C"), clobber_abi("C"));
331349
| ---------------- ^^^^^^^^^^^^^^^^
332350
| |
333351
| clobber_abi previously specified here
334352

335353
error: duplicate argument named `a`
336-
--> $DIR/parse-error.rs:119:35
354+
--> $DIR/parse-error.rs:125:35
337355
|
338356
LL | global_asm!("{a}", a = const FOO, a = const BAR);
339357
| ------------- ^^^^^^^^^^^^^ duplicate argument
340358
| |
341359
| previously here
342360

343361
error: argument never used
344-
--> $DIR/parse-error.rs:119:35
362+
--> $DIR/parse-error.rs:125:35
345363
|
346364
LL | global_asm!("{a}", a = const FOO, a = const BAR);
347365
| ^^^^^^^^^^^^^ argument never used
348366
|
349367
= help: if this argument is intentionally unused, consider using it in an asm comment: `"/* {1} */"`
350368

351369
error: expected one of `clobber_abi`, `const`, or `options`, found `""`
352-
--> $DIR/parse-error.rs:122:28
370+
--> $DIR/parse-error.rs:128:28
353371
|
354372
LL | global_asm!("", options(), "");
355373
| ^^ expected one of `clobber_abi`, `const`, or `options`
356374

357375
error: expected one of `clobber_abi`, `const`, or `options`, found `"{}"`
358-
--> $DIR/parse-error.rs:124:30
376+
--> $DIR/parse-error.rs:130:30
359377
|
360378
LL | global_asm!("{}", const FOO, "{}", const FOO);
361379
| ^^^^ expected one of `clobber_abi`, `const`, or `options`
362380

363381
error: asm template must be a string literal
364-
--> $DIR/parse-error.rs:126:13
382+
--> $DIR/parse-error.rs:132:13
365383
|
366384
LL | global_asm!(format!("{{{}}}", 0), const FOO);
367385
| ^^^^^^^^^^^^^^^^^^^^
368386
|
369387
= note: this error originates in the macro `format` (in Nightly builds, run with -Z macro-backtrace for more info)
370388

371389
error: asm template must be a string literal
372-
--> $DIR/parse-error.rs:128:20
390+
--> $DIR/parse-error.rs:134:20
373391
|
374392
LL | global_asm!("{1}", format!("{{{}}}", 0), const FOO, const BAR);
375393
| ^^^^^^^^^^^^^^^^^^^^
@@ -439,6 +457,6 @@ LL | let mut bar = 0;
439457
LL | asm!("{1}", in("x0") foo, const bar);
440458
| ^^^ non-constant value
441459

442-
error: aborting due to 63 previous errors
460+
error: aborting due to 66 previous errors
443461

444462
For more information about this error, try `rustc --explain E0435`.

Diff for: src/test/ui/asm/issue-87802.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
// only-x86_64
1+
// needs-asm-support
2+
// ignore-nvptx64
3+
// ignore-spirv
4+
// ignore-wasm32
25
// Make sure rustc doesn't ICE on asm! when output type is !.
36

47
#![feature(asm)]

Diff for: src/test/ui/asm/issue-87802.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: cannot use value of type `!` for inline assembly
2-
--> $DIR/issue-87802.rs:9:36
2+
--> $DIR/issue-87802.rs:12:36
33
|
44
LL | asm!("/* {0} */", out(reg) x);
55
| ^

Diff for: src/test/ui/asm/naked-functions-ffi.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// check-pass
2-
// only-x86_64
2+
// needs-asm-support
33
#![feature(asm)]
44
#![feature(naked_functions)]
55
#![crate_type = "lib"]
+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
error: unused variable: `a`
2+
--> $DIR/naked-functions-unused.rs:15:32
3+
|
4+
LL | pub extern "C" fn function(a: usize, b: usize) -> usize {
5+
| ^ help: if this is intentional, prefix it with an underscore: `_a`
6+
|
7+
note: the lint level is defined here
8+
--> $DIR/naked-functions-unused.rs:4:9
9+
|
10+
LL | #![deny(unused)]
11+
| ^^^^^^
12+
= note: `#[deny(unused_variables)]` implied by `#[deny(unused)]`
13+
14+
error: unused variable: `b`
15+
--> $DIR/naked-functions-unused.rs:15:42
16+
|
17+
LL | pub extern "C" fn function(a: usize, b: usize) -> usize {
18+
| ^ help: if this is intentional, prefix it with an underscore: `_b`
19+
20+
error: unused variable: `a`
21+
--> $DIR/naked-functions-unused.rs:24:38
22+
|
23+
LL | pub extern "C" fn associated(a: usize, b: usize) -> usize {
24+
| ^ help: if this is intentional, prefix it with an underscore: `_a`
25+
26+
error: unused variable: `b`
27+
--> $DIR/naked-functions-unused.rs:24:48
28+
|
29+
LL | pub extern "C" fn associated(a: usize, b: usize) -> usize {
30+
| ^ help: if this is intentional, prefix it with an underscore: `_b`
31+
32+
error: unused variable: `a`
33+
--> $DIR/naked-functions-unused.rs:30:41
34+
|
35+
LL | pub extern "C" fn method(&self, a: usize, b: usize) -> usize {
36+
| ^ help: if this is intentional, prefix it with an underscore: `_a`
37+
38+
error: unused variable: `b`
39+
--> $DIR/naked-functions-unused.rs:30:51
40+
|
41+
LL | pub extern "C" fn method(&self, a: usize, b: usize) -> usize {
42+
| ^ help: if this is intentional, prefix it with an underscore: `_b`
43+
44+
error: unused variable: `a`
45+
--> $DIR/naked-functions-unused.rs:38:40
46+
|
47+
LL | extern "C" fn trait_associated(a: usize, b: usize) -> usize {
48+
| ^ help: if this is intentional, prefix it with an underscore: `_a`
49+
50+
error: unused variable: `b`
51+
--> $DIR/naked-functions-unused.rs:38:50
52+
|
53+
LL | extern "C" fn trait_associated(a: usize, b: usize) -> usize {
54+
| ^ help: if this is intentional, prefix it with an underscore: `_b`
55+
56+
error: unused variable: `a`
57+
--> $DIR/naked-functions-unused.rs:44:43
58+
|
59+
LL | extern "C" fn trait_method(&self, a: usize, b: usize) -> usize {
60+
| ^ help: if this is intentional, prefix it with an underscore: `_a`
61+
62+
error: unused variable: `b`
63+
--> $DIR/naked-functions-unused.rs:44:53
64+
|
65+
LL | extern "C" fn trait_method(&self, a: usize, b: usize) -> usize {
66+
| ^ help: if this is intentional, prefix it with an underscore: `_b`
67+
68+
error: aborting due to 10 previous errors
69+

0 commit comments

Comments
 (0)