summaryrefslogtreecommitdiffstats
path: root/tests/run-make-fulldeps/metadata-flag-frobs-symbols
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:03 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:03 +0000
commit64d98f8ee037282c35007b64c2649055c56af1db (patch)
tree5492bcf97fce41ee1c0b1cc2add283f3e66cdab0 /tests/run-make-fulldeps/metadata-flag-frobs-symbols
parentAdding debian version 1.67.1+dfsg1-1. (diff)
downloadrustc-64d98f8ee037282c35007b64c2649055c56af1db.tar.xz
rustc-64d98f8ee037282c35007b64c2649055c56af1db.zip
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/run-make-fulldeps/metadata-flag-frobs-symbols')
-rw-r--r--tests/run-make-fulldeps/metadata-flag-frobs-symbols/Makefile10
-rw-r--r--tests/run-make-fulldeps/metadata-flag-frobs-symbols/bar.rs8
-rw-r--r--tests/run-make-fulldeps/metadata-flag-frobs-symbols/foo.rs6
3 files changed, 24 insertions, 0 deletions
diff --git a/tests/run-make-fulldeps/metadata-flag-frobs-symbols/Makefile b/tests/run-make-fulldeps/metadata-flag-frobs-symbols/Makefile
new file mode 100644
index 000000000..dc6b10f4e
--- /dev/null
+++ b/tests/run-make-fulldeps/metadata-flag-frobs-symbols/Makefile
@@ -0,0 +1,10 @@
+include ../tools.mk
+
+all:
+ $(RUSTC) foo.rs -C metadata=a -C extra-filename=-a
+ $(RUSTC) foo.rs -C metadata=b -C extra-filename=-b
+ $(RUSTC) bar.rs \
+ --extern foo1=$(TMPDIR)/libfoo-a.rlib \
+ --extern foo2=$(TMPDIR)/libfoo-b.rlib \
+ --print link-args
+ $(call RUN,bar)
diff --git a/tests/run-make-fulldeps/metadata-flag-frobs-symbols/bar.rs b/tests/run-make-fulldeps/metadata-flag-frobs-symbols/bar.rs
new file mode 100644
index 000000000..1e6957a36
--- /dev/null
+++ b/tests/run-make-fulldeps/metadata-flag-frobs-symbols/bar.rs
@@ -0,0 +1,8 @@
+extern crate foo1;
+extern crate foo2;
+
+fn main() {
+ let a = foo1::foo();
+ let b = foo2::foo();
+ assert!(a as *const _ != b as *const _);
+}
diff --git a/tests/run-make-fulldeps/metadata-flag-frobs-symbols/foo.rs b/tests/run-make-fulldeps/metadata-flag-frobs-symbols/foo.rs
new file mode 100644
index 000000000..696aed2fa
--- /dev/null
+++ b/tests/run-make-fulldeps/metadata-flag-frobs-symbols/foo.rs
@@ -0,0 +1,6 @@
+#![crate_name = "foo"]
+#![crate_type = "rlib"]
+
+static FOO: usize = 3;
+
+pub fn foo() -> &'static usize { &FOO }