summary refs log tree commit diff
path: root/src/test/ui/consts/miri_unleashed/inline_asm.rs
blob: b9421330d050e72d7ea55cc64df755ad903cae8f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// compile-flags: -Zunleash-the-miri-inside-of-you
// only-x86_64
#![feature(asm,llvm_asm)]
#![allow(const_err)]
#![allow(deprecated)] // llvm_asm!

fn main() {}

// Make sure we catch executing inline assembly.
static TEST_BAD1: () = {
    unsafe { llvm_asm!("xor %eax, %eax" ::: "eax"); }
    //~^ ERROR could not evaluate static initializer
    //~| NOTE inline assembly is not supported
    //~| NOTE in this expansion of llvm_asm!
    //~| NOTE in this expansion of llvm_asm!
};

// Make sure we catch executing inline assembly.
static TEST_BAD2: () = {
    unsafe { asm!("nop"); }
    //~^ ERROR could not evaluate static initializer
    //~| NOTE inline assembly is not supported
};