diff options
Diffstat (limited to 'src/test/ui/asm/x86_64/duplicate-options.rs')
-rw-r--r-- | src/test/ui/asm/x86_64/duplicate-options.rs | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/test/ui/asm/x86_64/duplicate-options.rs b/src/test/ui/asm/x86_64/duplicate-options.rs new file mode 100644 index 000000000..a8dce1f8d --- /dev/null +++ b/src/test/ui/asm/x86_64/duplicate-options.rs @@ -0,0 +1,29 @@ +// only-x86_64 +// run-rustfix + +use std::arch::{asm, global_asm}; + +fn main() { + unsafe { + asm!("", options(nomem, nomem)); + //~^ ERROR the `nomem` option was already provided + asm!("", options(att_syntax, att_syntax)); + //~^ ERROR the `att_syntax` option was already provided + asm!("", options(nostack, att_syntax), options(nostack)); + //~^ ERROR the `nostack` option was already provided + asm!("", options(nostack, nostack), options(nostack), options(nostack)); + //~^ ERROR the `nostack` option was already provided + //~| ERROR the `nostack` option was already provided + //~| ERROR the `nostack` option was already provided + asm!( + "", + options(nomem, noreturn), + options(att_syntax, noreturn), //~ ERROR the `noreturn` option was already provided + options(nomem, nostack), //~ ERROR the `nomem` option was already provided + options(noreturn), //~ ERROR the `noreturn` option was already provided + ); + } +} + +global_asm!("", options(att_syntax, att_syntax)); +//~^ ERROR the `att_syntax` option was already provided |