diff --git a/tests/ui/asm/unsupported-option.fixed b/tests/ui/asm/unsupported-option.fixed new file mode 100644 index 0000000000000..c2ff13bbc5516 --- /dev/null +++ b/tests/ui/asm/unsupported-option.fixed @@ -0,0 +1,10 @@ +//@ run-rustfix + +use std::arch::global_asm; + +fn main() {} + +global_asm!("", options(att_syntax, 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!` diff --git a/tests/ui/asm/unsupported-option.rs b/tests/ui/asm/unsupported-option.rs new file mode 100644 index 0000000000000..672aedf230ca7 --- /dev/null +++ b/tests/ui/asm/unsupported-option.rs @@ -0,0 +1,10 @@ +//@ run-rustfix + +use std::arch::global_asm; + +fn main() {} + +global_asm!("", options(att_syntax, 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!` diff --git a/tests/ui/asm/unsupported-option.stderr b/tests/ui/asm/unsupported-option.stderr new file mode 100644 index 0000000000000..c040b0364d7b7 --- /dev/null +++ b/tests/ui/asm/unsupported-option.stderr @@ -0,0 +1,20 @@ +error: the `nomem` option cannot be used with `global_asm!` + --> $DIR/unsupported-option.rs:7:37 + | +LL | global_asm!("", options(att_syntax, 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 + | +LL | global_asm!("", options(att_syntax, 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 + | +LL | global_asm!("", options(att_syntax, nomem, readonly, noreturn, raw)); + | ^^^^^^^^ the `noreturn` option is not meaningful for global-scoped inline assembly + +error: aborting due to 3 previous errors +