Add UI test for duplicate asm! options warning

This commit is contained in:
Camelid 2020-06-13 17:59:13 -07:00
parent 2be403ce3e
commit 7aaadb69e4
2 changed files with 57 additions and 0 deletions

View File

@ -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
}
}

View File

@ -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