2019-01-16 05:32:03 +00:00
|
|
|
// Regression test for Issue #53787: Fix ICE when creating a label in inline assembler with macros.
|
|
|
|
|
2019-12-14 04:28:32 +01:00
|
|
|
// build-fail
|
2019-07-27 13:47:26 +03:00
|
|
|
// ignore-emscripten
|
|
|
|
|
2019-01-16 05:32:03 +00:00
|
|
|
#![feature(asm)]
|
|
|
|
|
|
|
|
macro_rules! fake_jump {
|
|
|
|
($id:expr) => {
|
|
|
|
unsafe {
|
|
|
|
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!");
|
|
|
|
}
|