about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2024-06-29 14:07:23 +0200
committerGitHub <noreply@github.com>2024-06-29 14:07:23 +0200
commit69f355a74bf54ff088bbf73d3a540f1a4585003d (patch)
treebeef905311b36ab5a9853b10d2e79c34b03c6d7a
parent38983df5c7bab68242b061fbd9eaf071fedfa921 (diff)
parent8cbeedac8de7bbf7676129f07f338d106a162036 (diff)
downloadrust-69f355a74bf54ff088bbf73d3a540f1a4585003d.tar.gz
rust-69f355a74bf54ff088bbf73d3a540f1a4585003d.zip
Rollup merge of #127116 - GuillaumeGomez:run-make-return-non-c-like-enum, r=Kobzol,jieyouxu
Migrate `run-make/return-non-c-like-enum` to `rmake.rs`

Part of https://github.com/rust-lang/rust/issues/121876.

r? `@Kobzol`
-rw-r--r--src/tools/tidy/src/allowed_run_make_makefiles.txt1
-rw-r--r--tests/run-make/return-non-c-like-enum/Makefile8
-rw-r--r--tests/run-make/return-non-c-like-enum/rmake.rs18
3 files changed, 18 insertions, 9 deletions
diff --git a/src/tools/tidy/src/allowed_run_make_makefiles.txt b/src/tools/tidy/src/allowed_run_make_makefiles.txt
index 8cd7c264118..b9c214da330 100644
--- a/src/tools/tidy/src/allowed_run_make_makefiles.txt
+++ b/src/tools/tidy/src/allowed_run_make_makefiles.txt
@@ -140,7 +140,6 @@ run-make/remap-path-prefix/Makefile
 run-make/reproducible-build-2/Makefile
 run-make/reproducible-build/Makefile
 run-make/return-non-c-like-enum-from-c/Makefile
-run-make/return-non-c-like-enum/Makefile
 run-make/rlib-chain/Makefile
 run-make/rlib-format-packed-bundled-libs-2/Makefile
 run-make/rlib-format-packed-bundled-libs-3/Makefile
diff --git a/tests/run-make/return-non-c-like-enum/Makefile b/tests/run-make/return-non-c-like-enum/Makefile
deleted file mode 100644
index 0c8d8bf3acc..00000000000
--- a/tests/run-make/return-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/return-non-c-like-enum/rmake.rs b/tests/run-make/return-non-c-like-enum/rmake.rs
new file mode 100644
index 00000000000..e698790b43c
--- /dev/null
+++ b/tests/run-make/return-non-c-like-enum/rmake.rs
@@ -0,0 +1,18 @@
+// Check that we treat enum variants like union members in call ABIs.
+// Added in #68443.
+// Original issue: #68190.
+
+//@ ignore-cross-compile
+
+use run_make_support::{cc, extra_c_flags, extra_cxx_flags, run, rustc, static_lib_name};
+
+fn main() {
+    rustc().crate_type("staticlib").input("nonclike.rs").run();
+    cc().input("test.c")
+        .arg(&static_lib_name("nonclike"))
+        .out_exe("test")
+        .args(&extra_c_flags())
+        .args(&extra_cxx_flags())
+        .run();
+    run("test");
+}