Skip to content

Commit 3eefb75

Browse files
AB1908Vardhan Thigle
AB1908
authored and
Vardhan Thigle
committed
Add regression test to close rust-lang#53787
1 parent 781b8b8 commit 3eefb75

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// Regression test for Issue #53787: Fix ICE when creating a label in inline assembler with macros.
2+
3+
#![feature(asm)]
4+
5+
macro_rules! fake_jump {
6+
($id:expr) => {
7+
unsafe {
8+
9+
asm!(
10+
"
11+
jmp $0
12+
lea eax, [ebx]
13+
xor eax, 0xDEADBEEF
14+
retn
15+
$0:
16+
"::"0"($id)::"volatile", "intel");
17+
}
18+
};
19+
}
20+
21+
fn main() {
22+
fake_jump!("FirstFunc"); //~ ERROR invalid value for constraint in inline assembly
23+
println!("Hello, world!");
24+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
error[E0669]: invalid value for constraint in inline assembly
2+
--> $DIR/issue-53787-inline-assembler-macro.rs:22:16
3+
|
4+
LL | fake_jump!("FirstFunc"); //~ ERROR invalid value for constraint in inline assembly
5+
| ^^^^^^^^^^^
6+
7+
error: aborting due to previous error
8+
9+
For more information about this error, try `rustc --explain E0669`.

0 commit comments

Comments
 (0)