-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
05ae666
commit 4b13b81
Showing
3 changed files
with
42 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
error: att syntax is the default syntax on this target, and trying to use this directive may cause issues | ||
--> $DIR/inline-syntax.rs:22:15 | ||
| | ||
LL | asm!(".att_syntax noprefix", "nop"); | ||
| ^^^^^^^^^^^^^^^^^^^^ help: remove this assembler directive | ||
|
||
error: att syntax is the default syntax on this target, and trying to use this directive may cause issues | ||
--> $DIR/inline-syntax.rs:25:15 | ||
| | ||
LL | asm!(".att_syntax bbb noprefix", "nop"); | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this assembler directive | ||
|
||
error: aborting due to 2 previous errors | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,38 @@ | ||
#![feature(asm, llvm_asm)] | ||
// revisions: x86_64 arm | ||
//[x86_64] compile-flags: --target x86_64-unknown-linux-gnu | ||
//[arm] compile-flags: --target armv7-unknown-linux-gnueabihf | ||
|
||
#![feature(no_core, lang_items, rustc_attrs)] | ||
#![no_core] | ||
|
||
#[rustc_builtin_macro] | ||
macro_rules! asm { | ||
() => {}; | ||
} | ||
|
||
#[lang = "sized"] | ||
trait Sized {} | ||
|
||
fn main() { | ||
unsafe { | ||
asm!(".intel_syntax noprefix", "nop"); | ||
//~^ ERROR intel syntax is the default syntax on this target | ||
//[x86_64]~^ ERROR intel syntax is the default syntax on this target | ||
asm!(".intel_syntax aaa noprefix", "nop"); | ||
//~^ ERROR intel syntax is the default syntax on this target | ||
//[x86_64]~^ ERROR intel syntax is the default syntax on this target | ||
asm!(".att_syntax noprefix", "nop"); | ||
//~^ ERROR using the .att_syntax directive may cause issues | ||
//[x86_64]~^ ERROR using the .att_syntax directive may cause issues | ||
//[arm]~^^ att syntax is the default syntax on this target | ||
asm!(".att_syntax bbb noprefix", "nop"); | ||
//~^ ERROR using the .att_syntax directive may cause issues | ||
//[x86_64]~^ ERROR using the .att_syntax directive may cause issues | ||
//[arm]~^^ att syntax is the default syntax on this target | ||
asm!(".intel_syntax noprefix; nop"); | ||
//~^ ERROR intel syntax is the default syntax on this target | ||
//[x86_64]~^ 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 | ||
//[x86_64]~^^^ ERROR intel syntax is the default syntax on this target | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters