Skip to content

Commit b20bd73

Browse files
authored
Rollup merge of #71317 - RalfJung:unleash-inline-asm, r=ecstatic-morse
miri-unleash test for llvm_asm r? @oli-obk @ecstatic-morse
2 parents ab44c77 + f6adbc3 commit b20bd73

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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 inline assembly.
9+
static TEST_BAD: () = {
10+
unsafe { llvm_asm!("xor %eax, %eax" ::: "eax"); }
11+
//~^ ERROR could not evaluate static initializer
12+
//~| NOTE in this expansion of llvm_asm!
13+
//~| NOTE inline assembly is not supported
14+
};
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:10: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)