about summary refs log tree commit diff
path: root/tests/run-make/volatile-intrinsics/rmake.rs
blob: 1d19b65214337e88e4406d53433c8d9ce8d3e18d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//@ ignore-cross-compile

use run_make_support::{assert_contains, rfs, 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");
}