Skip to content

Commit 5688458

Browse files
committed
miri-unleash test for llvm_asm
1 parent 861996e commit 5688458

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// compile-flags: -Zunleash-the-miri-inside-of-you
2+
// only-x86_64
3+
#![feature(llvm_asm)]
4+
#![allow(const_err)]
5+
6+
fn main() {}
7+
8+
// Make sure we catch executing bad drop functions.
9+
// The actual error is tested by the error-pattern above.
10+
static TEST_BAD: () = {
11+
unsafe { llvm_asm!("xor %eax, %eax" ::: "eax"); }
12+
//~^ ERROR could not evaluate static initializer
13+
//~| NOTE in this expansion of llvm_asm!
14+
//~| NOTE inline assembly is not supported
15+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
error[E0080]: could not evaluate static initializer
2+
--> $DIR/inline_asm.rs:11:14
3+
|
4+
LL | unsafe { llvm_asm!("xor %eax, %eax" ::: "eax"); }
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ inline assembly is not supported
6+
|
7+
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
8+
9+
error: aborting due to previous error
10+
11+
For more information about this error, try `rustc --explain E0080`.

0 commit comments

Comments
 (0)