Skip to content

Commit

Permalink
update aarch64 asm tests
Browse files Browse the repository at this point in the history
  • Loading branch information
folkertdev committed Jul 27, 2024
1 parent 8859da0 commit 3e4ddc3
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 47 deletions.
12 changes: 6 additions & 6 deletions tests/ui/asm/aarch64/bad-options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ fn main() {
}

global_asm!("", options(nomem));
//~^ ERROR expected one of
//~^ ERROR the `nomem` option cannot be used with `global_asm!`
global_asm!("", options(readonly));
//~^ ERROR expected one of
//~^ ERROR the `readonly` option cannot be used with `global_asm!`
global_asm!("", options(noreturn));
//~^ ERROR expected one of
//~^ ERROR the `noreturn` option cannot be used with `global_asm!`
global_asm!("", options(pure));
//~^ ERROR expected one of
//~^ ERROR the `pure` option cannot be used with `global_asm!`
global_asm!("", options(nostack));
//~^ ERROR expected one of
//~^ ERROR the `nostack` option cannot be used with `global_asm!`
global_asm!("", options(preserves_flags));
//~^ ERROR expected one of
//~^ ERROR the `preserves_flags` option cannot be used with `global_asm!`
24 changes: 12 additions & 12 deletions tests/ui/asm/aarch64/bad-options.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -36,41 +36,41 @@ LL | asm!("{}", out(reg) foo, clobber_abi("C"));
| |
| generic outputs

error: expected one of `)`, `att_syntax`, or `raw`, found `nomem`
error: the `nomem` option cannot be used with `global_asm!`
--> $DIR/bad-options.rs:28:25
|
LL | global_asm!("", options(nomem));
| ^^^^^ expected one of `)`, `att_syntax`, or `raw`
| ^^^^^ the `nomem` option is not meaningful for global-scoped inline assembly

error: expected one of `)`, `att_syntax`, or `raw`, found `readonly`
error: the `readonly` option cannot be used with `global_asm!`
--> $DIR/bad-options.rs:30:25
|
LL | global_asm!("", options(readonly));
| ^^^^^^^^ expected one of `)`, `att_syntax`, or `raw`
| ^^^^^^^^ the `readonly` option is not meaningful for global-scoped inline assembly

error: expected one of `)`, `att_syntax`, or `raw`, found `noreturn`
error: the `noreturn` option cannot be used with `global_asm!`
--> $DIR/bad-options.rs:32:25
|
LL | global_asm!("", options(noreturn));
| ^^^^^^^^ expected one of `)`, `att_syntax`, or `raw`
| ^^^^^^^^ the `noreturn` option is not meaningful for global-scoped inline assembly

error: expected one of `)`, `att_syntax`, or `raw`, found `pure`
error: the `pure` option cannot be used with `global_asm!`
--> $DIR/bad-options.rs:34:25
|
LL | global_asm!("", options(pure));
| ^^^^ expected one of `)`, `att_syntax`, or `raw`
| ^^^^ the `pure` option is not meaningful for global-scoped inline assembly

error: expected one of `)`, `att_syntax`, or `raw`, found `nostack`
error: the `nostack` option cannot be used with `global_asm!`
--> $DIR/bad-options.rs:36:25
|
LL | global_asm!("", options(nostack));
| ^^^^^^^ expected one of `)`, `att_syntax`, or `raw`
| ^^^^^^^ the `nostack` option is not meaningful for global-scoped inline assembly

error: expected one of `)`, `att_syntax`, or `raw`, found `preserves_flags`
error: the `preserves_flags` option cannot be used with `global_asm!`
--> $DIR/bad-options.rs:38:25
|
LL | global_asm!("", options(preserves_flags));
| ^^^^^^^^^^^^^^^ expected one of `)`, `att_syntax`, or `raw`
| ^^^^^^^^^^^^^^^ the `preserves_flags` option is not meaningful for global-scoped inline assembly

error: invalid ABI for `clobber_abi`
--> $DIR/bad-options.rs:20:18
Expand Down
2 changes: 2 additions & 0 deletions tests/ui/asm/aarch64/parse-error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,10 @@ global_asm!("", options(FOO));
//~^ ERROR expected one of
global_asm!("", options(nomem FOO));
//~^ ERROR expected one of
//~| ERROR the `nomem` option cannot be used with `global_asm!`
global_asm!("", options(nomem, FOO));
//~^ ERROR expected one of
//~| ERROR the `nomem` option cannot be used with `global_asm!`
global_asm!("{}", options(), const FOO);
global_asm!("", clobber_abi(FOO));
//~^ ERROR expected string literal
Expand Down
48 changes: 30 additions & 18 deletions tests/ui/asm/aarch64/parse-error.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -218,92 +218,104 @@ error: expected one of `)`, `att_syntax`, or `raw`, found `FOO`
LL | global_asm!("", options(FOO));
| ^^^ expected one of `)`, `att_syntax`, or `raw`

error: expected one of `)`, `att_syntax`, or `raw`, found `nomem`
error: the `nomem` option cannot be used with `global_asm!`
--> $DIR/parse-error.rs:99:25
|
LL | global_asm!("", options(nomem FOO));
| ^^^^^ expected one of `)`, `att_syntax`, or `raw`
| ^^^^^ the `nomem` option is not meaningful for global-scoped inline assembly

error: expected one of `)`, `att_syntax`, or `raw`, found `nomem`
--> $DIR/parse-error.rs:101:25
error: expected one of `)` or `,`, found `FOO`
--> $DIR/parse-error.rs:99:31
|
LL | global_asm!("", options(nomem FOO));
| ^^^ expected one of `)` or `,`

error: the `nomem` option cannot be used with `global_asm!`
--> $DIR/parse-error.rs:102:25
|
LL | global_asm!("", options(nomem, FOO));
| ^^^^^ the `nomem` option is not meaningful for global-scoped inline assembly

error: expected one of `)`, `att_syntax`, or `raw`, found `FOO`
--> $DIR/parse-error.rs:102:32
|
LL | global_asm!("", options(nomem, FOO));
| ^^^^^ expected one of `)`, `att_syntax`, or `raw`
| ^^^ expected one of `)`, `att_syntax`, or `raw`

error: expected string literal
--> $DIR/parse-error.rs:104:29
--> $DIR/parse-error.rs:106:29
|
LL | global_asm!("", clobber_abi(FOO));
| ^^^ not a string literal

error: expected one of `)` or `,`, found `FOO`
--> $DIR/parse-error.rs:106:33
--> $DIR/parse-error.rs:108:33
|
LL | global_asm!("", clobber_abi("C" FOO));
| ^^^ expected one of `)` or `,`

error: expected string literal
--> $DIR/parse-error.rs:108:34
--> $DIR/parse-error.rs:110:34
|
LL | global_asm!("", clobber_abi("C", FOO));
| ^^^ not a string literal

error: `clobber_abi` cannot be used with `global_asm!`
--> $DIR/parse-error.rs:110:19
--> $DIR/parse-error.rs:112:19
|
LL | global_asm!("{}", clobber_abi("C"), const FOO);
| ^^^^^^^^^^^^^^^^

error: `clobber_abi` cannot be used with `global_asm!`
--> $DIR/parse-error.rs:112:28
--> $DIR/parse-error.rs:114:28
|
LL | global_asm!("", options(), clobber_abi("C"));
| ^^^^^^^^^^^^^^^^

error: `clobber_abi` cannot be used with `global_asm!`
--> $DIR/parse-error.rs:114:30
--> $DIR/parse-error.rs:116:30
|
LL | global_asm!("{}", options(), clobber_abi("C"), const FOO);
| ^^^^^^^^^^^^^^^^

error: duplicate argument named `a`
--> $DIR/parse-error.rs:116:35
--> $DIR/parse-error.rs:118:35
|
LL | global_asm!("{a}", a = const FOO, a = const BAR);
| ------------- ^^^^^^^^^^^^^ duplicate argument
| |
| previously here

error: argument never used
--> $DIR/parse-error.rs:116:35
--> $DIR/parse-error.rs:118:35
|
LL | global_asm!("{a}", a = const FOO, a = const BAR);
| ^^^^^^^^^^^^^ argument never used
|
= help: if this argument is intentionally unused, consider using it in an asm comment: `"/* {1} */"`

error: expected one of `clobber_abi`, `const`, `options`, or `sym`, found `""`
--> $DIR/parse-error.rs:119:28
--> $DIR/parse-error.rs:121:28
|
LL | global_asm!("", options(), "");
| ^^ expected one of `clobber_abi`, `const`, `options`, or `sym`

error: expected one of `clobber_abi`, `const`, `options`, or `sym`, found `"{}"`
--> $DIR/parse-error.rs:121:30
--> $DIR/parse-error.rs:123:30
|
LL | global_asm!("{}", const FOO, "{}", const FOO);
| ^^^^ expected one of `clobber_abi`, `const`, `options`, or `sym`

error: asm template must be a string literal
--> $DIR/parse-error.rs:123:13
--> $DIR/parse-error.rs:125:13
|
LL | global_asm!(format!("{{{}}}", 0), const FOO);
| ^^^^^^^^^^^^^^^^^^^^
|
= note: this error originates in the macro `format` (in Nightly builds, run with -Z macro-backtrace for more info)

error: asm template must be a string literal
--> $DIR/parse-error.rs:125:20
--> $DIR/parse-error.rs:127:20
|
LL | global_asm!("{1}", format!("{{{}}}", 0), const FOO, const BAR);
| ^^^^^^^^^^^^^^^^^^^^
Expand Down Expand Up @@ -398,6 +410,6 @@ help: consider using `const` instead of `let`
LL | const bar: /* Type */ = 0;
| ~~~~~ ++++++++++++

error: aborting due to 57 previous errors
error: aborting due to 59 previous errors

For more information about this error, try `rustc --explain E0435`.
2 changes: 1 addition & 1 deletion tests/ui/asm/unsupported-option.fixed
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::arch::global_asm;

fn main() {}

global_asm!("", options(att_syntax, raw));
global_asm!("", options( raw));
//~^ ERROR the `nomem` option cannot be used with `global_asm!`
//~| ERROR the `readonly` option cannot be used with `global_asm!`
//~| ERROR the `noreturn` option cannot be used with `global_asm!`
2 changes: 1 addition & 1 deletion tests/ui/asm/unsupported-option.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::arch::global_asm;

fn main() {}

global_asm!("", options(att_syntax, nomem, readonly, noreturn, raw));
global_asm!("", options(nomem, readonly, noreturn, raw));
//~^ ERROR the `nomem` option cannot be used with `global_asm!`
//~| ERROR the `readonly` option cannot be used with `global_asm!`
//~| ERROR the `noreturn` option cannot be used with `global_asm!`
18 changes: 9 additions & 9 deletions tests/ui/asm/unsupported-option.stderr
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
error: the `nomem` option cannot be used with `global_asm!`
--> $DIR/unsupported-option.rs:7:37
--> $DIR/unsupported-option.rs:7:25
|
LL | global_asm!("", options(att_syntax, nomem, readonly, noreturn, raw));
| ^^^^^ the `nomem` option is not meaningful for global-scoped inline assembly
LL | global_asm!("", options(nomem, readonly, noreturn, raw));
| ^^^^^ the `nomem` option is not meaningful for global-scoped inline assembly

error: the `readonly` option cannot be used with `global_asm!`
--> $DIR/unsupported-option.rs:7:44
--> $DIR/unsupported-option.rs:7:32
|
LL | global_asm!("", options(att_syntax, nomem, readonly, noreturn, raw));
| ^^^^^^^^ the `readonly` option is not meaningful for global-scoped inline assembly
LL | global_asm!("", options(nomem, readonly, noreturn, raw));
| ^^^^^^^^ the `readonly` option is not meaningful for global-scoped inline assembly

error: the `noreturn` option cannot be used with `global_asm!`
--> $DIR/unsupported-option.rs:7:54
--> $DIR/unsupported-option.rs:7:42
|
LL | global_asm!("", options(att_syntax, nomem, readonly, noreturn, raw));
| ^^^^^^^^ the `noreturn` option is not meaningful for global-scoped inline assembly
LL | global_asm!("", options(nomem, readonly, noreturn, raw));
| ^^^^^^^^ the `noreturn` option is not meaningful for global-scoped inline assembly

error: aborting due to 3 previous errors

0 comments on commit 3e4ddc3

Please sign in to comment.