Skip to content

Commit

Permalink
Rollup merge of rust-lang#57657 - AB1908:regression-test-case, r=niko…
Browse files Browse the repository at this point in the history
…matsakis

Add regression test to close rust-lang#53787

Fixes rust-lang#53787
  • Loading branch information
Centril authored Jan 18, 2019
2 parents d2300af + 0edc5c9 commit 0eb4bdc
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/test/ui/issue-53787-inline-assembler-macro.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Regression test for Issue #53787: Fix ICE when creating a label in inline assembler with macros.

#![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!");
}
9 changes: 9 additions & 0 deletions src/test/ui/issue-53787-inline-assembler-macro.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
error[E0669]: invalid value for constraint in inline assembly
--> $DIR/issue-53787-inline-assembler-macro.rs:21:16
|
LL | fake_jump!("FirstFunc"); //~ ERROR invalid value for constraint in inline assembly
| ^^^^^^^^^^^

error: aborting due to previous error

For more information about this error, try `rustc --explain E0669`.

0 comments on commit 0eb4bdc

Please sign in to comment.