Skip to content

Commit 0eb4bdc

Browse files
authored
Rollup merge of #57657 - AB1908:regression-test-case, r=nikomatsakis
Add regression test to close #53787 Fixes #53787
2 parents d2300af + 0edc5c9 commit 0eb4bdc

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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+
asm!(
9+
"
10+
jmp $0
11+
lea eax, [ebx]
12+
xor eax, 0xDEADBEEF
13+
retn
14+
$0:
15+
"::"0"($id)::"volatile", "intel");
16+
}
17+
};
18+
}
19+
20+
fn main() {
21+
fake_jump!("FirstFunc"); //~ ERROR invalid value for constraint in inline assembly
22+
println!("Hello, world!");
23+
}
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:21: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)