Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 7aaadb6

Browse files
committed
Add UI test for duplicate asm! options warning
1 parent 2be403c commit 7aaadb6

File tree

2 files changed

+57
-0
lines changed

2 files changed

+57
-0
lines changed

src/test/ui/asm/duplicate-options.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// only-x86_64
2+
// build-pass
3+
4+
#![feature(asm)]
5+
6+
fn main() {
7+
unsafe {
8+
asm!("", options(nomem, nomem));
9+
//~^ WARNING the `nomem` option was already provided
10+
asm!("", options(att_syntax, att_syntax));
11+
//~^ WARNING the `att_syntax` option was already provided
12+
asm!("", options(nostack, att_syntax), options(nostack));
13+
//~^ WARNING the `nostack` option was already provided
14+
asm!("", options(nostack, nostack), options(nostack), options(nostack));
15+
//~^ WARNING the `nostack` option was already provided
16+
//~| WARNING the `nostack` option was already provided
17+
//~| WARNING the `nostack` option was already provided
18+
}
19+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
warning: the `nomem` option was already provided
2+
--> $DIR/duplicate-options.rs:8:33
3+
|
4+
LL | asm!("", options(nomem, nomem));
5+
| ^^^^^ help: remove this option
6+
7+
warning: the `att_syntax` option was already provided
8+
--> $DIR/duplicate-options.rs:10:38
9+
|
10+
LL | asm!("", options(att_syntax, att_syntax));
11+
| ^^^^^^^^^^ help: remove this option
12+
13+
warning: the `nostack` option was already provided
14+
--> $DIR/duplicate-options.rs:12:56
15+
|
16+
LL | asm!("", options(nostack, att_syntax), options(nostack));
17+
| ^^^^^^^ help: remove this option
18+
19+
warning: the `nostack` option was already provided
20+
--> $DIR/duplicate-options.rs:14:35
21+
|
22+
LL | asm!("", options(nostack, nostack), options(nostack), options(nostack));
23+
| ^^^^^^^ help: remove this option
24+
25+
warning: the `nostack` option was already provided
26+
--> $DIR/duplicate-options.rs:14:53
27+
|
28+
LL | asm!("", options(nostack, nostack), options(nostack), options(nostack));
29+
| ^^^^^^^ help: remove this option
30+
31+
warning: the `nostack` option was already provided
32+
--> $DIR/duplicate-options.rs:14:71
33+
|
34+
LL | asm!("", options(nostack, nostack), options(nostack), options(nostack));
35+
| ^^^^^^^ help: remove this option
36+
37+
warning: 6 warnings emitted
38+

0 commit comments

Comments
 (0)