rust/src/test/ui/issues/issue-53787-inline-assembler-macro.rs

27 lines
569 B
Rust
Raw Normal View History

2019-01-15 23:32:03 -06:00
// Regression test for Issue #53787: Fix ICE when creating a label in inline assembler with macros.
// build-fail
// ignore-emscripten
2020-02-14 10:54:40 -06:00
#![feature(llvm_asm)]
2019-01-15 23:32:03 -06:00
macro_rules! fake_jump {
($id:expr) => {
unsafe {
2020-02-14 10:54:40 -06:00
llvm_asm!(
2019-01-15 23:32:03 -06:00
"
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!");
}