summaryrefslogtreecommitdiffstats
path: root/tests/run-make/windows-safeseh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-07 05:48:48 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-07 05:48:48 +0000
commitef24de24a82fe681581cc130f342363c47c0969a (patch)
tree0d494f7e1a38b95c92426f58fe6eaa877303a86c /tests/run-make/windows-safeseh
parentReleasing progress-linux version 1.74.1+dfsg1-1~progress7.99u1. (diff)
downloadrustc-ef24de24a82fe681581cc130f342363c47c0969a.tar.xz
rustc-ef24de24a82fe681581cc130f342363c47c0969a.zip
Merging upstream version 1.75.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/run-make/windows-safeseh')
-rw-r--r--tests/run-make/windows-safeseh/Makefile19
-rw-r--r--tests/run-make/windows-safeseh/bar.rs1
-rw-r--r--tests/run-make/windows-safeseh/baz.rs4
-rw-r--r--tests/run-make/windows-safeseh/foo.rs4
4 files changed, 28 insertions, 0 deletions
diff --git a/tests/run-make/windows-safeseh/Makefile b/tests/run-make/windows-safeseh/Makefile
new file mode 100644
index 000000000..d6a403961
--- /dev/null
+++ b/tests/run-make/windows-safeseh/Makefile
@@ -0,0 +1,19 @@
+# only-windows
+# needs-rust-lld
+
+include ../tools.mk
+
+all: foo bar
+
+# Ensure that LLD can link when an .rlib contains a synthetic object
+# file referencing exported or used symbols.
+foo:
+ $(RUSTC) -C linker=rust-lld foo.rs
+
+# Ensure that LLD can link when /WHOLEARCHIVE: is used with an .rlib.
+# Previously, lib.rmeta was not marked as (trivially) SAFESEH-aware.
+bar: baz
+ $(RUSTC) -C linker=rust-lld -C link-arg=/WHOLEARCHIVE:libbaz.rlib bar.rs
+
+baz:
+ $(RUSTC) baz.rs
diff --git a/tests/run-make/windows-safeseh/bar.rs b/tests/run-make/windows-safeseh/bar.rs
new file mode 100644
index 000000000..f328e4d9d
--- /dev/null
+++ b/tests/run-make/windows-safeseh/bar.rs
@@ -0,0 +1 @@
+fn main() {}
diff --git a/tests/run-make/windows-safeseh/baz.rs b/tests/run-make/windows-safeseh/baz.rs
new file mode 100644
index 000000000..8d5b9dc5a
--- /dev/null
+++ b/tests/run-make/windows-safeseh/baz.rs
@@ -0,0 +1,4 @@
+#![crate_type = "rlib"]
+
+#[no_mangle]
+extern "C" fn baz() {}
diff --git a/tests/run-make/windows-safeseh/foo.rs b/tests/run-make/windows-safeseh/foo.rs
new file mode 100644
index 000000000..93ac3641b
--- /dev/null
+++ b/tests/run-make/windows-safeseh/foo.rs
@@ -0,0 +1,4 @@
+#![crate_type = "cdylib"]
+
+#[no_mangle]
+extern "C" fn foo() {}