2021-03-08 22:48:08 -06:00
|
|
|
// revisions: x86_64 arm
|
|
|
|
//[x86_64] compile-flags: --target x86_64-unknown-linux-gnu
|
2021-03-23 23:52:57 -05:00
|
|
|
//[x86_64] check-pass
|
2021-06-13 13:19:39 -05:00
|
|
|
//[x86_64] needs-llvm-components: x86
|
2021-04-11 09:11:02 -05:00
|
|
|
//[x86_64_allowed] compile-flags: --target x86_64-unknown-linux-gnu
|
|
|
|
//[x86_64_allowed] check-pass
|
2021-06-13 13:19:39 -05:00
|
|
|
//[x86_64_allowed] needs-llvm-components: x86
|
2021-03-08 22:48:08 -06:00
|
|
|
//[arm] compile-flags: --target armv7-unknown-linux-gnueabihf
|
2021-03-23 23:52:57 -05:00
|
|
|
//[arm] build-fail
|
2021-06-13 13:19:39 -05:00
|
|
|
//[arm] needs-llvm-components: arm
|
2022-03-19 10:50:24 -05:00
|
|
|
// needs-asm-support
|
2021-03-08 22:48:08 -06:00
|
|
|
|
|
|
|
#![feature(no_core, lang_items, rustc_attrs)]
|
2021-03-23 23:52:57 -05:00
|
|
|
#![crate_type = "rlib"]
|
2021-03-08 22:48:08 -06:00
|
|
|
#![no_core]
|
2021-04-11 09:11:02 -05:00
|
|
|
#![cfg_attr(x86_64_allowed, allow(bad_asm_style))]
|
2021-03-08 22:48:08 -06:00
|
|
|
|
|
|
|
#[rustc_builtin_macro]
|
|
|
|
macro_rules! asm {
|
|
|
|
() => {};
|
|
|
|
}
|
2021-04-13 12:11:11 -05:00
|
|
|
#[rustc_builtin_macro]
|
|
|
|
macro_rules! global_asm {
|
|
|
|
() => {};
|
|
|
|
}
|
2021-03-08 22:48:08 -06:00
|
|
|
|
|
|
|
#[lang = "sized"]
|
|
|
|
trait Sized {}
|
2021-02-18 13:27:11 -06:00
|
|
|
|
2021-03-23 23:52:57 -05:00
|
|
|
pub fn main() {
|
2021-02-18 13:27:11 -06:00
|
|
|
unsafe {
|
|
|
|
asm!(".intel_syntax noprefix", "nop");
|
2021-03-23 23:52:57 -05:00
|
|
|
//[x86_64]~^ WARN avoid using `.intel_syntax`
|
|
|
|
//[arm]~^^ ERROR unknown directive
|
2021-02-18 13:27:11 -06:00
|
|
|
asm!(".intel_syntax aaa noprefix", "nop");
|
2021-03-23 23:52:57 -05:00
|
|
|
//[x86_64]~^ WARN avoid using `.intel_syntax`
|
|
|
|
//[arm]~^^ ERROR unknown directive
|
2021-02-18 13:27:11 -06:00
|
|
|
asm!(".att_syntax noprefix", "nop");
|
2021-03-23 23:52:57 -05:00
|
|
|
//[x86_64]~^ WARN avoid using `.att_syntax`
|
|
|
|
//[arm]~^^ ERROR unknown directive
|
2021-02-18 13:27:11 -06:00
|
|
|
asm!(".att_syntax bbb noprefix", "nop");
|
2021-03-23 23:52:57 -05:00
|
|
|
//[x86_64]~^ WARN avoid using `.att_syntax`
|
|
|
|
//[arm]~^^ ERROR unknown directive
|
2021-02-20 00:17:18 -06:00
|
|
|
asm!(".intel_syntax noprefix; nop");
|
2021-03-23 23:52:57 -05:00
|
|
|
//[x86_64]~^ WARN avoid using `.intel_syntax`
|
|
|
|
//[arm]~^^ ERROR unknown directive
|
2021-02-20 00:17:18 -06:00
|
|
|
|
|
|
|
asm!(
|
|
|
|
r"
|
|
|
|
.intel_syntax noprefix
|
|
|
|
nop"
|
|
|
|
);
|
2021-03-23 23:52:57 -05:00
|
|
|
//[x86_64]~^^^ WARN avoid using `.intel_syntax`
|
|
|
|
//[arm]~^^^^ ERROR unknown directive
|
2021-02-18 13:27:11 -06:00
|
|
|
}
|
|
|
|
}
|
2021-04-13 12:11:11 -05:00
|
|
|
|
|
|
|
global_asm!(".intel_syntax noprefix", "nop");
|
|
|
|
//[x86_64]~^ WARN avoid using `.intel_syntax`
|
|
|
|
// Assembler errors don't have line numbers, so no error on ARM
|