Skip to content

Commit 4b13b81

Browse files
committed
Test x86 and arm outputs
1 parent 05ae666 commit 4b13b81

File tree

3 files changed

+42
-13
lines changed

3 files changed

+42
-13
lines changed
+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
error: att syntax is the default syntax on this target, and trying to use this directive may cause issues
2+
--> $DIR/inline-syntax.rs:22:15
3+
|
4+
LL | asm!(".att_syntax noprefix", "nop");
5+
| ^^^^^^^^^^^^^^^^^^^^ help: remove this assembler directive
6+
7+
error: att syntax is the default syntax on this target, and trying to use this directive may cause issues
8+
--> $DIR/inline-syntax.rs:25:15
9+
|
10+
LL | asm!(".att_syntax bbb noprefix", "nop");
11+
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this assembler directive
12+
13+
error: aborting due to 2 previous errors
14+

src/test/ui/asm/inline-syntax.rs

+22-7
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,38 @@
1-
#![feature(asm, llvm_asm)]
1+
// revisions: x86_64 arm
2+
//[x86_64] compile-flags: --target x86_64-unknown-linux-gnu
3+
//[arm] compile-flags: --target armv7-unknown-linux-gnueabihf
4+
5+
#![feature(no_core, lang_items, rustc_attrs)]
6+
#![no_core]
7+
8+
#[rustc_builtin_macro]
9+
macro_rules! asm {
10+
() => {};
11+
}
12+
13+
#[lang = "sized"]
14+
trait Sized {}
215

316
fn main() {
417
unsafe {
518
asm!(".intel_syntax noprefix", "nop");
6-
//~^ ERROR intel syntax is the default syntax on this target
19+
//[x86_64]~^ ERROR intel syntax is the default syntax on this target
720
asm!(".intel_syntax aaa noprefix", "nop");
8-
//~^ ERROR intel syntax is the default syntax on this target
21+
//[x86_64]~^ ERROR intel syntax is the default syntax on this target
922
asm!(".att_syntax noprefix", "nop");
10-
//~^ ERROR using the .att_syntax directive may cause issues
23+
//[x86_64]~^ ERROR using the .att_syntax directive may cause issues
24+
//[arm]~^^ att syntax is the default syntax on this target
1125
asm!(".att_syntax bbb noprefix", "nop");
12-
//~^ ERROR using the .att_syntax directive may cause issues
26+
//[x86_64]~^ ERROR using the .att_syntax directive may cause issues
27+
//[arm]~^^ att syntax is the default syntax on this target
1328
asm!(".intel_syntax noprefix; nop");
14-
//~^ ERROR intel syntax is the default syntax on this target
29+
//[x86_64]~^ ERROR intel syntax is the default syntax on this target
1530

1631
asm!(
1732
r"
1833
.intel_syntax noprefix
1934
nop"
2035
);
21-
//~^^^ ERROR intel syntax is the default syntax on this target
36+
//[x86_64]~^^^ ERROR intel syntax is the default syntax on this target
2237
}
2338
}

src/test/ui/asm/inline-syntax.stderr src/test/ui/asm/inline-syntax.x86_64.stderr

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
error: intel syntax is the default syntax on this target, and trying to use this directive may cause issues
2-
--> $DIR/inline-syntax.rs:5:15
2+
--> $DIR/inline-syntax.rs:18:15
33
|
44
LL | asm!(".intel_syntax noprefix", "nop");
55
| ^^^^^^^^^^^^^^^^^^^^^^ help: remove this assembler directive
66

77
error: intel syntax is the default syntax on this target, and trying to use this directive may cause issues
8-
--> $DIR/inline-syntax.rs:7:15
8+
--> $DIR/inline-syntax.rs:20:15
99
|
1010
LL | asm!(".intel_syntax aaa noprefix", "nop");
1111
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this assembler directive
1212

1313
error: using the .att_syntax directive may cause issues, use the att_syntax option instead
14-
--> $DIR/inline-syntax.rs:9:15
14+
--> $DIR/inline-syntax.rs:22:15
1515
|
1616
LL | asm!(".att_syntax noprefix", "nop");
1717
| ^^^^^^^^^^^^^^^^^^^^
@@ -22,7 +22,7 @@ LL | asm!("", "nop", options(att_syntax));
2222
| -- ^^^^^^^^^^^^^^^^^^^^^
2323

2424
error: using the .att_syntax directive may cause issues, use the att_syntax option instead
25-
--> $DIR/inline-syntax.rs:11:15
25+
--> $DIR/inline-syntax.rs:25:15
2626
|
2727
LL | asm!(".att_syntax bbb noprefix", "nop");
2828
| ^^^^^^^^^^^^^^^^^^^^^^^^
@@ -33,13 +33,13 @@ LL | asm!("", "nop", options(att_syntax));
3333
| -- ^^^^^^^^^^^^^^^^^^^^^
3434

3535
error: intel syntax is the default syntax on this target, and trying to use this directive may cause issues
36-
--> $DIR/inline-syntax.rs:13:15
36+
--> $DIR/inline-syntax.rs:28:15
3737
|
3838
LL | asm!(".intel_syntax noprefix; nop");
3939
| ^^^^^^^^^^^^^^^^^^^^^^ help: remove this assembler directive
4040

4141
error: intel syntax is the default syntax on this target, and trying to use this directive may cause issues
42-
--> $DIR/inline-syntax.rs:18:14
42+
--> $DIR/inline-syntax.rs:33:14
4343
|
4444
LL | .intel_syntax noprefix
4545
| ______________^

0 commit comments

Comments
 (0)