mirror of
https://github.com/rust-lang/rust.git
synced 2025-11-12 13:59:41 +00:00
By taking the existing `expanded-exhaustive.rs` test and running it with both `Zunpretty=expanded` *and* `Zunpretty=hir`. Also rename some files, and split the asm parts out so they only run on x86-64.
32 lines
707 B
Rust
32 lines
707 B
Rust
//@ revisions: expanded hir
|
|
//@[expanded]compile-flags: -Zunpretty=expanded
|
|
//@[expanded]check-pass
|
|
//@[hir]compile-flags: -Zunpretty=hir
|
|
//@[hir]check-pass
|
|
//@ edition:2024
|
|
//@ only-x86_64
|
|
//
|
|
// asm parts of exhaustive.rs. Separate because we only run this on x86_64.
|
|
|
|
mod expressions {
|
|
/// ExprKind::InlineAsm
|
|
fn expr_inline_asm() {
|
|
let x;
|
|
core::arch::asm!(
|
|
"mov {tmp}, {x}",
|
|
"shl {tmp}, 1",
|
|
"shl {x}, 2",
|
|
"add {x}, {tmp}",
|
|
x = inout(reg) x,
|
|
tmp = out(reg) _,
|
|
);
|
|
}
|
|
}
|
|
|
|
mod items {
|
|
/// ItemKind::GlobalAsm
|
|
mod item_global_asm {
|
|
core::arch::global_asm!(".globl my_asm_func");
|
|
}
|
|
}
|