diff --git a/src/test/ui/asm/duplicate-options.rs b/src/test/ui/asm/duplicate-options.rs new file mode 100644 index 00000000000..9c447451511 --- /dev/null +++ b/src/test/ui/asm/duplicate-options.rs @@ -0,0 +1,19 @@ +// only-x86_64 +// build-pass + +#![feature(asm)] + +fn main() { + unsafe { + asm!("", options(nomem, nomem)); + //~^ WARNING the `nomem` option was already provided + asm!("", options(att_syntax, att_syntax)); + //~^ WARNING the `att_syntax` option was already provided + asm!("", options(nostack, att_syntax), options(nostack)); + //~^ WARNING the `nostack` option was already provided + asm!("", options(nostack, nostack), options(nostack), options(nostack)); + //~^ WARNING the `nostack` option was already provided + //~| WARNING the `nostack` option was already provided + //~| WARNING the `nostack` option was already provided + } +} diff --git a/src/test/ui/asm/duplicate-options.stderr b/src/test/ui/asm/duplicate-options.stderr new file mode 100644 index 00000000000..113aca8da90 --- /dev/null +++ b/src/test/ui/asm/duplicate-options.stderr @@ -0,0 +1,38 @@ +warning: the `nomem` option was already provided + --> $DIR/duplicate-options.rs:8:33 + | +LL | asm!("", options(nomem, nomem)); + | ^^^^^ help: remove this option + +warning: the `att_syntax` option was already provided + --> $DIR/duplicate-options.rs:10:38 + | +LL | asm!("", options(att_syntax, att_syntax)); + | ^^^^^^^^^^ help: remove this option + +warning: the `nostack` option was already provided + --> $DIR/duplicate-options.rs:12:56 + | +LL | asm!("", options(nostack, att_syntax), options(nostack)); + | ^^^^^^^ help: remove this option + +warning: the `nostack` option was already provided + --> $DIR/duplicate-options.rs:14:35 + | +LL | asm!("", options(nostack, nostack), options(nostack), options(nostack)); + | ^^^^^^^ help: remove this option + +warning: the `nostack` option was already provided + --> $DIR/duplicate-options.rs:14:53 + | +LL | asm!("", options(nostack, nostack), options(nostack), options(nostack)); + | ^^^^^^^ help: remove this option + +warning: the `nostack` option was already provided + --> $DIR/duplicate-options.rs:14:71 + | +LL | asm!("", options(nostack, nostack), options(nostack), options(nostack)); + | ^^^^^^^ help: remove this option + +warning: 6 warnings emitted +