rust/tests/run-make/volatile-intrinsics/rmake.rs
许杰友 Jieyou Xu (Joe) d69cc1ccbf tests: update for rfs rename
2024-07-17 13:34:18 +00:00

19 lines
515 B
Rust

//@ ignore-cross-compile
use run_make_support::rfs;
use run_make_support::{assert_contains, run, rustc};
fn main() {
// The tests must pass...
rustc().input("main.rs").run();
run("main");
// ... and the loads/stores must not be optimized out.
rustc().input("main.rs").emit("llvm-ir").run();
let raw_llvm_ir = rfs::read("main.ll");
let llvm_ir = String::from_utf8_lossy(&raw_llvm_ir);
assert_contains(&llvm_ir, "load volatile");
assert_contains(&llvm_ir, "store volatile");
}