about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2024-04-05 16:38:50 +0200
committerGitHub <noreply@github.com>2024-04-05 16:38:50 +0200
commitc36c0095776f1cbc39d15a206b4b1018b329b4aa (patch)
tree9ed9abd91f511bb2e69f804517658519d76de23c /tests
parentcb6a1c8d455a26c82165e3285557da2d82e22385 (diff)
parentfad8213150b2973f9cccb7b1e09cdf5ff7cdded8 (diff)
downloadrust-c36c0095776f1cbc39d15a206b4b1018b329b4aa.tar.gz
rust-c36c0095776f1cbc39d15a206b4b1018b329b4aa.zip
Rollup merge of #123149 - jieyouxu:rmake-arguments-non-c-like-enum, r=Mark-Simulacrum
Port argument-non-c-like-enum to Rust

Part of #121876.
Diffstat (limited to 'tests')
-rw-r--r--tests/run-make/arguments-non-c-like-enum/Makefile8
-rw-r--r--tests/run-make/arguments-non-c-like-enum/rmake.rs20
2 files changed, 20 insertions, 8 deletions
diff --git a/tests/run-make/arguments-non-c-like-enum/Makefile b/tests/run-make/arguments-non-c-like-enum/Makefile
deleted file mode 100644
index 0c8d8bf3acc..00000000000
--- a/tests/run-make/arguments-non-c-like-enum/Makefile
+++ /dev/null
@@ -1,8 +0,0 @@
-# ignore-cross-compile
-include ../tools.mk
-
-all:
-	$(RUSTC) --crate-type=staticlib nonclike.rs
-	$(CC) test.c $(call STATICLIB,nonclike) $(call OUT_EXE,test) \
-		$(EXTRACFLAGS) $(EXTRACXXFLAGS)
-	$(call RUN,test)
diff --git a/tests/run-make/arguments-non-c-like-enum/rmake.rs b/tests/run-make/arguments-non-c-like-enum/rmake.rs
new file mode 100644
index 00000000000..624a7fb2251
--- /dev/null
+++ b/tests/run-make/arguments-non-c-like-enum/rmake.rs
@@ -0,0 +1,20 @@
+//! Check that non-trivial `repr(C)` enum in Rust has valid C layout.
+//@ ignore-cross-compile
+
+extern crate run_make_support;
+
+use run_make_support::{cc, extra_c_flags, extra_cxx_flags, run, rustc, static_lib};
+
+pub fn main() {
+    use std::path::Path;
+
+    rustc().input("nonclike.rs").crate_type("staticlib").run();
+    cc().input("test.c")
+        .input(static_lib("nonclike"))
+        .out_exe("test")
+        .args(&extra_c_flags())
+        .args(&extra_cxx_flags())
+        .inspect(|cmd| eprintln!("{cmd:?}"))
+        .run();
+    run("test");
+}