2023-04-20 15:19:36 +00:00
|
|
|
//@only-target-x86_64
|
|
|
|
//@ignore-target-aarch64
|
2021-04-22 09:31:13 +00:00
|
|
|
|
2020-10-09 10:45:29 +00:00
|
|
|
#[warn(clippy::inline_asm_x86_intel_syntax)]
|
|
|
|
mod warn_intel {
|
|
|
|
pub(super) unsafe fn use_asm() {
|
2021-12-13 00:00:51 +00:00
|
|
|
use std::arch::asm;
|
2020-10-09 10:45:29 +00:00
|
|
|
asm!("");
|
2023-07-28 19:35:48 +00:00
|
|
|
//~^ ERROR: Intel x86 assembly syntax used
|
2020-10-09 10:45:29 +00:00
|
|
|
asm!("", options());
|
2023-07-28 19:35:48 +00:00
|
|
|
//~^ ERROR: Intel x86 assembly syntax used
|
2020-10-09 10:45:29 +00:00
|
|
|
asm!("", options(nostack));
|
2023-07-28 19:35:48 +00:00
|
|
|
//~^ ERROR: Intel x86 assembly syntax used
|
2020-10-09 10:45:29 +00:00
|
|
|
asm!("", options(att_syntax));
|
|
|
|
asm!("", options(nostack, att_syntax));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#[warn(clippy::inline_asm_x86_att_syntax)]
|
|
|
|
mod warn_att {
|
|
|
|
pub(super) unsafe fn use_asm() {
|
2021-12-13 00:00:51 +00:00
|
|
|
use std::arch::asm;
|
2020-10-09 10:45:29 +00:00
|
|
|
asm!("");
|
|
|
|
asm!("", options());
|
|
|
|
asm!("", options(nostack));
|
|
|
|
asm!("", options(att_syntax));
|
2023-07-28 19:35:48 +00:00
|
|
|
//~^ ERROR: AT&T x86 assembly syntax used
|
2020-10-09 10:45:29 +00:00
|
|
|
asm!("", options(nostack, att_syntax));
|
2023-07-28 19:35:48 +00:00
|
|
|
//~^ ERROR: AT&T x86 assembly syntax used
|
2020-10-09 10:45:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-22 09:31:13 +00:00
|
|
|
#[cfg(target_arch = "x86_64")]
|
2020-10-09 10:45:29 +00:00
|
|
|
fn main() {
|
|
|
|
unsafe {
|
|
|
|
warn_att::use_asm();
|
|
|
|
warn_intel::use_asm();
|
|
|
|
}
|
|
|
|
}
|