2024-06-23 15:13:55 -05:00
|
|
|
//@ ignore-cross-compile
|
|
|
|
|
2024-07-28 17:13:50 -05:00
|
|
|
use run_make_support::{assert_contains, rfs, run, rustc};
|
2024-06-23 15:13:55 -05:00
|
|
|
|
|
|
|
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();
|
|
|
|
|
2024-07-17 07:42:06 -05:00
|
|
|
let raw_llvm_ir = rfs::read("main.ll");
|
2024-06-23 15:13:55 -05:00
|
|
|
let llvm_ir = String::from_utf8_lossy(&raw_llvm_ir);
|
|
|
|
assert_contains(&llvm_ir, "load volatile");
|
|
|
|
assert_contains(&llvm_ir, "store volatile");
|
|
|
|
}
|