rust/test-cargo-miri/build.rs

18 lines
396 B
Rust
Raw Normal View History

2020-04-20 03:38:38 -05:00
#![feature(llvm_asm)]
fn not_in_miri() -> i32 {
// Inline assembly definitely does not work in Miri.
let dummy = 42;
unsafe {
2020-04-20 03:38:38 -05:00
llvm_asm!("" : : "r"(&dummy));
}
return dummy;
}
fn main() {
not_in_miri();
println!("cargo:rerun-if-changed=build.rs");
println!("cargo:rerun-if-env-changed=MIRITESTVAR");
println!("cargo:rustc-env=MIRITESTVAR=testval");
}