about summary refs log tree commit diff
diff options
context:
space:
mode:
authorOneirical <manchot@videotron.ca>2024-07-19 16:23:29 -0400
committerOneirical <manchot@videotron.ca>2024-07-22 10:03:41 -0400
commit632f01306b2a5b7f47e554cf1280f5ef8fc9f710 (patch)
tree078f68ca4b62294a56aa3c59423bcd576056e6ed
parentaee3dc4c6cc0e018b648a340fb98af10887ce4ba (diff)
downloadrust-632f01306b2a5b7f47e554cf1280f5ef8fc9f710.tar.gz
rust-632f01306b2a5b7f47e554cf1280f5ef8fc9f710.zip
rewrite lto-linkage-used-attr to rmake
-rw-r--r--src/tools/tidy/src/allowed_run_make_makefiles.txt1
-rw-r--r--tests/run-make/lto-linkage-used-attr/Makefile8
-rw-r--r--tests/run-make/lto-linkage-used-attr/rmake.rs14
3 files changed, 14 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 6b3533c2578..5cb580e9f79 100644
--- a/src/tools/tidy/src/allowed_run_make_makefiles.txt
+++ b/src/tools/tidy/src/allowed_run_make_makefiles.txt
@@ -47,7 +47,6 @@ run-make/link-cfg/Makefile
 run-make/link-framework/Makefile
 run-make/long-linker-command-lines-cmd-exe/Makefile
 run-make/long-linker-command-lines/Makefile
-run-make/lto-linkage-used-attr/Makefile
 run-make/macos-deployment-target/Makefile
 run-make/min-global-align/Makefile
 run-make/native-link-modifier-bundle/Makefile
diff --git a/tests/run-make/lto-linkage-used-attr/Makefile b/tests/run-make/lto-linkage-used-attr/Makefile
deleted file mode 100644
index fed41a00f84..00000000000
--- a/tests/run-make/lto-linkage-used-attr/Makefile
+++ /dev/null
@@ -1,8 +0,0 @@
-include ../tools.mk
-
-# Verify that the impl_* symbols are preserved. #108030
-# only-x86_64-unknown-linux-gnu
-
-all:
-	$(RUSTC) -Cdebuginfo=0 -Copt-level=3 lib.rs
-	$(RUSTC) -Clto=fat -Cdebuginfo=0 -Copt-level=3 main.rs
diff --git a/tests/run-make/lto-linkage-used-attr/rmake.rs b/tests/run-make/lto-linkage-used-attr/rmake.rs
new file mode 100644
index 00000000000..114c5dcf521
--- /dev/null
+++ b/tests/run-make/lto-linkage-used-attr/rmake.rs
@@ -0,0 +1,14 @@
+// Link time optimizations (LTO) used to snip away some important symbols
+// when setting optimization level to 3 or higher.
+// This is an LLVM, not a rustc bug, fixed here: https://reviews.llvm.org/D145293
+// This test checks that the impl_* symbols are preserved as they should.
+// See https://github.com/rust-lang/rust/issues/108030
+
+//FIXME(Oneirical): try it on more than only-x86_64-unknown-linux-gnu
+
+use run_make_support::rustc;
+
+fn main() {
+    rustc().arg("-Cdebuginfo=0").opt_level("3").input("lib.rs").run();
+    rustc().arg("-Clto=fat").arg("-Cdebuginfo=0").opt_level("3").input("main.rs").run();
+}