2024-02-27 14:25:18 +00:00
|
|
|
//@revisions: i686 x86_64
|
|
|
|
//@[i686] only-target-i686
|
|
|
|
//@[x86_64] only-target-x86_64
|
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 {
|
2024-02-27 14:25:18 +00:00
|
|
|
use std::arch::{asm, global_asm};
|
|
|
|
|
2020-10-09 10:45:29 +00:00
|
|
|
pub(super) unsafe fn use_asm() {
|
|
|
|
asm!("");
|
2023-08-24 19:32:12 +00:00
|
|
|
//~^ ERROR: Intel x86 assembly syntax used
|
2020-10-09 10:45:29 +00:00
|
|
|
asm!("", options());
|
2023-08-24 19:32:12 +00:00
|
|
|
//~^ ERROR: Intel x86 assembly syntax used
|
2020-10-09 10:45:29 +00:00
|
|
|
asm!("", options(nostack));
|
2023-08-24 19:32:12 +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));
|
|
|
|
}
|
2024-02-27 14:25:18 +00:00
|
|
|
|
|
|
|
global_asm!("");
|
|
|
|
//~^ ERROR: Intel x86 assembly syntax used
|
|
|
|
global_asm!("", options());
|
|
|
|
//~^ ERROR: Intel x86 assembly syntax used
|
|
|
|
global_asm!("", options(att_syntax));
|
2020-10-09 10:45:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#[warn(clippy::inline_asm_x86_att_syntax)]
|
|
|
|
mod warn_att {
|
2024-02-27 14:25:18 +00:00
|
|
|
use std::arch::{asm, global_asm};
|
|
|
|
|
2020-10-09 10:45:29 +00:00
|
|
|
pub(super) unsafe fn use_asm() {
|
|
|
|
asm!("");
|
|
|
|
asm!("", options());
|
|
|
|
asm!("", options(nostack));
|
|
|
|
asm!("", options(att_syntax));
|
2023-08-24 19:32:12 +00:00
|
|
|
//~^ ERROR: AT&T x86 assembly syntax used
|
2020-10-09 10:45:29 +00:00
|
|
|
asm!("", options(nostack, att_syntax));
|
2023-08-24 19:32:12 +00:00
|
|
|
//~^ ERROR: AT&T x86 assembly syntax used
|
2020-10-09 10:45:29 +00:00
|
|
|
}
|
2024-02-27 14:25:18 +00:00
|
|
|
|
|
|
|
global_asm!("");
|
|
|
|
global_asm!("", options());
|
|
|
|
global_asm!("", options(att_syntax));
|
|
|
|
//~^ ERROR: AT&T x86 assembly syntax used
|
2020-10-09 10:45:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
unsafe {
|
|
|
|
warn_att::use_asm();
|
|
|
|
warn_intel::use_asm();
|
|
|
|
}
|
|
|
|
}
|