about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/tools/tidy/src/allowed_run_make_makefiles.txt1
-rw-r--r--tests/run-make/volatile-intrinsics/Makefile10
-rw-r--r--tests/run-make/volatile-intrinsics/rmake.rs18
3 files changed, 18 insertions, 11 deletions
diff --git a/src/tools/tidy/src/allowed_run_make_makefiles.txt b/src/tools/tidy/src/allowed_run_make_makefiles.txt
index 73ef7c5ba25..ad80ac8d7c9 100644
--- a/src/tools/tidy/src/allowed_run_make_makefiles.txt
+++ b/src/tools/tidy/src/allowed_run_make_makefiles.txt
@@ -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
diff --git a/tests/run-make/volatile-intrinsics/Makefile b/tests/run-make/volatile-intrinsics/Makefile
deleted file mode 100644
index 5672a045873..00000000000
--- a/tests/run-make/volatile-intrinsics/Makefile
+++ /dev/null
@@ -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
diff --git a/tests/run-make/volatile-intrinsics/rmake.rs b/tests/run-make/volatile-intrinsics/rmake.rs
new file mode 100644
index 00000000000..fb9be4bb9ba
--- /dev/null
+++ b/tests/run-make/volatile-intrinsics/rmake.rs
@@ -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");
+}