Migrate `volatile-intrinsics` to `rmake`

This commit is contained in:
Jerry Wang 2024-06-23 16:13:55 -04:00
parent be99243afc
commit 614e04226d
3 changed files with 18 additions and 11 deletions

View File

@ -186,7 +186,6 @@ run-make/track-pgo-dep-info/Makefile
run-make/translation/Makefile
run-make/type-mismatch-same-crate-name/Makefile
run-make/unstable-flag-required/Makefile
run-make/volatile-intrinsics/Makefile
run-make/wasm-exceptions-nostd/Makefile
run-make/wasm-override-linker/Makefile
run-make/weird-output-filenames/Makefile

View File

@ -1,10 +0,0 @@
# ignore-cross-compile
include ../tools.mk
all:
# The tests must pass...
$(RUSTC) main.rs
$(call RUN,main)
# ... and the loads/stores must not be optimized out.
$(RUSTC) main.rs --emit=llvm-ir
$(CGREP) "load volatile" "store volatile" < $(TMPDIR)/main.ll

View File

@ -0,0 +1,18 @@
//@ ignore-cross-compile
use run_make_support::fs_wrapper::read;
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 = 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");
}