about summary refs log tree commit diff
path: root/tests/run-make
diff options
context:
space:
mode:
authorJerry Wang <jerrylwang123@gmail.com>2024-06-23 16:13:55 -0400
committerJerry Wang <jerrylwang123@gmail.com>2024-06-29 08:14:00 -0400
commit614e04226df82e04c8c3ce30abfda67f26a93bc2 (patch)
tree59511ebc814a7f608931d9003e46d0d05da53371 /tests/run-make
parentbe99243afc9e12d5abac1ba475808fab6c28204b (diff)
downloadrust-614e04226df82e04c8c3ce30abfda67f26a93bc2.tar.gz
rust-614e04226df82e04c8c3ce30abfda67f26a93bc2.zip
Migrate `volatile-intrinsics` to `rmake`
Diffstat (limited to 'tests/run-make')
-rw-r--r--tests/run-make/volatile-intrinsics/Makefile10
-rw-r--r--tests/run-make/volatile-intrinsics/rmake.rs18
2 files changed, 18 insertions, 10 deletions
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");
+}