From: Ralf Jung Date: Wed, 28 Aug 2019 07:15:31 +0000 (+0200) Subject: test that build scripts do not run in Miri X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=71aae4ffa5a8ee36f09953d1b85c7b5c2818e0c6;p=rust.git test that build scripts do not run in Miri --- diff --git a/test-cargo-miri/Cargo.toml b/test-cargo-miri/Cargo.toml index 3abb437049f..c2460014b66 100644 --- a/test-cargo-miri/Cargo.toml +++ b/test-cargo-miri/Cargo.toml @@ -3,6 +3,7 @@ name = "cargo-miri-test" version = "0.1.0" authors = ["Oliver Schneider "] edition = "2018" +build = "build.rs" [dependencies] byteorder = "1.0" diff --git a/test-cargo-miri/build.rs b/test-cargo-miri/build.rs new file mode 100644 index 00000000000..950fc3c82bb --- /dev/null +++ b/test-cargo-miri/build.rs @@ -0,0 +1,15 @@ +#![feature(asm)] + +fn not_in_miri() -> i32 { + // Inline assembly definitely does not work in Miri. + let dummy = 42; + unsafe { + asm!("" : : "r"(&dummy)); + } + return dummy; +} + +fn main() { + not_in_miri(); + println!("cargo:rerun-if-changed=build.rs"); +}