summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/asm_syntax.rs
blob: 0220bf3331f5b0664b66d2a56a884353f5c23b96 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// only-x86_64
// ignore-aarch64

#[warn(clippy::inline_asm_x86_intel_syntax)]
mod warn_intel {
    pub(super) unsafe fn use_asm() {
        use std::arch::asm;
        asm!("");
        asm!("", options());
        asm!("", options(nostack));
        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() {
        use std::arch::asm;
        asm!("");
        asm!("", options());
        asm!("", options(nostack));
        asm!("", options(att_syntax));
        asm!("", options(nostack, att_syntax));
    }
}

#[cfg(target_arch = "x86_64")]
fn main() {
    unsafe {
        warn_att::use_asm();
        warn_intel::use_asm();
    }
}