Add UI test for duplicate asm!
options warning
This commit is contained in:
parent
2be403ce3e
commit
7aaadb69e4
19
src/test/ui/asm/duplicate-options.rs
Normal file
19
src/test/ui/asm/duplicate-options.rs
Normal 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
|
||||
}
|
||||
}
|
38
src/test/ui/asm/duplicate-options.stderr
Normal file
38
src/test/ui/asm/duplicate-options.stderr
Normal 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
|
||||
|
Loading…
Reference in New Issue
Block a user