Rollup merge of #57657 - AB1908:regression-test-case, r=nikomatsakis

Add regression test to close #53787

Fixes #53787
This commit is contained in:
Mazdak Farrokhzad 2019-01-18 22:56:44 +01:00 committed by GitHub
commit 0eb4bdc5f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 32 additions and 0 deletions

View File

@ -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!");
}

View File

@ -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`.