-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #71317 - RalfJung:unleash-inline-asm, r=ecstatic-morse
miri-unleash test for llvm_asm r? @oli-obk @ecstatic-morse
- Loading branch information
Showing
2 changed files
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// compile-flags: -Zunleash-the-miri-inside-of-you | ||
// only-x86_64 | ||
#![feature(llvm_asm)] | ||
#![allow(const_err)] | ||
|
||
fn main() {} | ||
|
||
// Make sure we catch executing inline assembly. | ||
static TEST_BAD: () = { | ||
unsafe { llvm_asm!("xor %eax, %eax" ::: "eax"); } | ||
//~^ ERROR could not evaluate static initializer | ||
//~| NOTE in this expansion of llvm_asm! | ||
//~| NOTE inline assembly is not supported | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
error[E0080]: could not evaluate static initializer | ||
--> $DIR/inline_asm.rs:10:14 | ||
| | ||
LL | unsafe { llvm_asm!("xor %eax, %eax" ::: "eax"); } | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ inline assembly is not supported | ||
| | ||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0080`. |