Take into account target default syntax

This commit is contained in:
asquared31415 2021-02-20 01:17:18 -05:00
parent 12c6a12d62
commit 39dcd01bf5
3 changed files with 107 additions and 60 deletions

View file

@ -3,12 +3,21 @@
fn main() {
unsafe {
asm!(".intel_syntax noprefix", "nop");
//~^ ERROR intel sytnax is the default syntax
//~^ ERROR intel syntax is the default syntax on this target
asm!(".intel_syntax aaa noprefix", "nop");
//~^ ERROR intel sytnax is the default syntax
//~^ ERROR intel syntax is the default syntax on this target
asm!(".att_syntax noprefix", "nop");
//~^ ERROR using the .att_syntax directive may cause issues
asm!(".att_syntax bbb noprefix", "nop");
//~^ ERROR using the .att_syntax directive may cause issues
asm!(".intel_syntax noprefix; nop");
//~^ ERROR intel syntax is the default syntax on this target
asm!(
r"
.intel_syntax noprefix
nop"
);
//~^^^ ERROR intel syntax is the default syntax on this target
}
}

View file

@ -1,14 +1,14 @@
error: intel sytnax is the default syntax, and trying to use this directive may cause issues
error: intel syntax is the default syntax on this target, and trying to use this directive may cause issues
--> $DIR/inline-syntax.rs:5:15
|
LL | asm!(".intel_syntax noprefix", "nop");
| ^^^^^^^^^^^^^^^^^^^^^^ help: Remove this assembler directive
| ^^^^^^^^^^^^^^^^^^^^^^ help: remove this assembler directive
error: intel sytnax is the default syntax, and trying to use this directive may cause issues
error: intel syntax is the default syntax on this target, and trying to use this directive may cause issues
--> $DIR/inline-syntax.rs:7:15
|
LL | asm!(".intel_syntax aaa noprefix", "nop");
| ^^^^^^^^^^^^^ help: Remove this assembler directive: `aaa noprefix`
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this assembler directive
error: using the .att_syntax directive may cause issues, use the att_syntax option instead
--> $DIR/inline-syntax.rs:9:15
@ -16,7 +16,7 @@ error: using the .att_syntax directive may cause issues, use the att_syntax opti
LL | asm!(".att_syntax noprefix", "nop");
| ^^^^^^^^^^^^^^^^^^^^
|
help: Remove the assembler directive and replace it with options(att_syntax)
help: remove the assembler directive and replace it with options(att_syntax)
|
LL | asm!("", "nop", options(att_syntax));
| -- ^^^^^^^^^^^^^^^^^^^^^
@ -25,12 +25,26 @@ error: using the .att_syntax directive may cause issues, use the att_syntax opti
--> $DIR/inline-syntax.rs:11:15
|
LL | asm!(".att_syntax bbb noprefix", "nop");
| ^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
help: Remove the assembler directive and replace it with options(att_syntax)
help: remove the assembler directive and replace it with options(att_syntax)
|
LL | asm!(" bbb noprefix", "nop", options(att_syntax));
| -- ^^^^^^^^^^^^^^^^^^^^^
LL | asm!("", "nop", options(att_syntax));
| -- ^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 4 previous errors
error: intel syntax is the default syntax on this target, and trying to use this directive may cause issues
--> $DIR/inline-syntax.rs:13:15
|
LL | asm!(".intel_syntax noprefix; nop");
| ^^^^^^^^^^^^^^^^^^^^^^ help: remove this assembler directive
error: intel syntax is the default syntax on this target, and trying to use this directive may cause issues
--> $DIR/inline-syntax.rs:18:14
|
LL | .intel_syntax noprefix
| ______________^
LL | | nop"
| |_ help: remove this assembler directive
error: aborting due to 6 previous errors