mirror of
https://github.com/rust-lang/rust.git
synced 2025-12-02 00:58:01 +00:00
Use `splice` to avoid shifting the other items twice. Put `extern crate std;` first so it's already resolved when we resolve `::std::prelude::rust_20XX`.
33 lines
734 B
Plaintext
33 lines
734 B
Plaintext
#[attr = MacroUse {arguments: UseAll}]
|
|
extern crate std;
|
|
#[prelude_import]
|
|
use std::prelude::rust_2024::*;
|
|
//@ 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;
|
|
asm!("mov {1}, {0}\nshl {1}, 1\nshl {0}, 2\nadd {0}, {1}",
|
|
inout(reg)
|
|
x,
|
|
out(reg)
|
|
_);
|
|
}
|
|
}
|
|
|
|
mod items {
|
|
/// ItemKind::GlobalAsm
|
|
mod item_global_asm {
|
|
global_asm! (".globl my_asm_func");
|
|
}
|
|
}
|