rust/src/test/ui/issues/issue-53787-inline-assembler-macro.rs
2020-03-26 15:49:22 +00:00

27 lines
569 B
Rust

// Regression test for Issue #53787: Fix ICE when creating a label in inline assembler with macros.
// build-fail
// ignore-emscripten
#![feature(llvm_asm)]
macro_rules! fake_jump {
($id:expr) => {
unsafe {
llvm_asm!(
"
jmp $0
lea eax, [ebx]
xor eax, 0xDEADBEEF
retn
$0:
"::"0"($id)::"volatile", "intel");
}
};
}
fn main() {
fake_jump!("FirstFunc"); //~ ERROR invalid value for constraint in inline assembly
println!("Hello, world!");
}