about summary refs log tree commit diff
diff options
context:
space:
mode:
authorOneirical <manchot@videotron.ca>2024-07-12 15:58:06 -0400
committerOneirical <manchot@videotron.ca>2024-07-19 12:27:47 -0400
commit1f976b43da767ae3926df75ccfda279159038bcb (patch)
treed2890ef8a411c41af5c727c6f15abede4115df89
parentdb8398db6f79ad70ce4598372bf807c68b62ea13 (diff)
downloadrust-1f976b43da767ae3926df75ccfda279159038bcb.tar.gz
rust-1f976b43da767ae3926df75ccfda279159038bcb.zip
rewrite linkage-attr-on-static to rmake
-rw-r--r--src/tools/tidy/src/allowed_run_make_makefiles.txt2
-rw-r--r--tests/run-make/linkage-attr-on-static/Makefile6
-rw-r--r--tests/run-make/linkage-attr-on-static/rmake.rs15
-rw-r--r--tests/run-make/pass-non-c-like-enum-to-c/Makefile6
4 files changed, 15 insertions, 14 deletions
diff --git a/src/tools/tidy/src/allowed_run_make_makefiles.txt b/src/tools/tidy/src/allowed_run_make_makefiles.txt
index 3f5de1f7c15..6a987c184df 100644
--- a/src/tools/tidy/src/allowed_run_make_makefiles.txt
+++ b/src/tools/tidy/src/allowed_run_make_makefiles.txt
@@ -48,7 +48,6 @@ run-make/libtest-junit/Makefile
 run-make/libtest-thread-limit/Makefile
 run-make/link-cfg/Makefile
 run-make/link-framework/Makefile
-run-make/linkage-attr-on-static/Makefile
 run-make/long-linker-command-lines-cmd-exe/Makefile
 run-make/long-linker-command-lines/Makefile
 run-make/lto-linkage-used-attr/Makefile
@@ -76,7 +75,6 @@ run-make/redundant-libs/Makefile
 run-make/remap-path-prefix-dwarf/Makefile
 run-make/reproducible-build-2/Makefile
 run-make/reproducible-build/Makefile
-run-make/return-non-c-like-enum-from-c/Makefile
 run-make/rlib-format-packed-bundled-libs-2/Makefile
 run-make/rlib-format-packed-bundled-libs-3/Makefile
 run-make/rlib-format-packed-bundled-libs/Makefile
diff --git a/tests/run-make/linkage-attr-on-static/Makefile b/tests/run-make/linkage-attr-on-static/Makefile
deleted file mode 100644
index ef50a7ef9f1..00000000000
--- a/tests/run-make/linkage-attr-on-static/Makefile
+++ /dev/null
@@ -1,6 +0,0 @@
-# ignore-cross-compile
-include ../tools.mk
-
-all: $(call NATIVE_STATICLIB,foo)
-	$(RUSTC) bar.rs
-	$(call RUN,bar) || exit 1
diff --git a/tests/run-make/linkage-attr-on-static/rmake.rs b/tests/run-make/linkage-attr-on-static/rmake.rs
new file mode 100644
index 00000000000..cd85542e958
--- /dev/null
+++ b/tests/run-make/linkage-attr-on-static/rmake.rs
@@ -0,0 +1,15 @@
+// #[linkage] is a useful attribute which can be applied to statics to allow
+// external linkage, something which was not possible before #18890. This test
+// checks that using this new feature results in successful compilation and execution.
+// See https://github.com/rust-lang/rust/pull/18890
+
+//@ ignore-cross-compile
+// Reason: the compiled binary is executed
+
+use run_make_support::{build_native_static_lib, run, rustc};
+
+fn main() {
+    build_native_static_lib("foo");
+    rustc().input("bar.rs").run();
+    run("bar");
+}
diff --git a/tests/run-make/pass-non-c-like-enum-to-c/Makefile b/tests/run-make/pass-non-c-like-enum-to-c/Makefile
deleted file mode 100644
index bd441d321bf..00000000000
--- a/tests/run-make/pass-non-c-like-enum-to-c/Makefile
+++ /dev/null
@@ -1,6 +0,0 @@
-# ignore-cross-compile
-include ../tools.mk
-
-all: $(call NATIVE_STATICLIB,test)
-	$(RUSTC) nonclike.rs -L$(TMPDIR) -ltest
-	$(call RUN,nonclike)