summary refs log tree commit diff
path: root/src/test/ui/issues/issue-53787-inline-assembler-macro.rs
blob: 38591b0a9f84e28fbab3bc48243a6d2f49856833 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// 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!");
}