diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:20:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:20:29 +0000 |
commit | 631cd5845e8de329d0e227aaa707d7ea228b8f8f (patch) | |
tree | a1b87c8f8cad01cf18f7c5f57a08f102771ed303 /tests/run-make/metadata-flag-frobs-symbols | |
parent | Adding debian version 1.69.0+dfsg1-1. (diff) | |
download | rustc-631cd5845e8de329d0e227aaa707d7ea228b8f8f.tar.xz rustc-631cd5845e8de329d0e227aaa707d7ea228b8f8f.zip |
Merging upstream version 1.70.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/run-make/metadata-flag-frobs-symbols')
-rw-r--r-- | tests/run-make/metadata-flag-frobs-symbols/Makefile | 11 | ||||
-rw-r--r-- | tests/run-make/metadata-flag-frobs-symbols/bar.rs | 8 | ||||
-rw-r--r-- | tests/run-make/metadata-flag-frobs-symbols/foo.rs | 6 |
3 files changed, 25 insertions, 0 deletions
diff --git a/tests/run-make/metadata-flag-frobs-symbols/Makefile b/tests/run-make/metadata-flag-frobs-symbols/Makefile new file mode 100644 index 000000000..53d7d0657 --- /dev/null +++ b/tests/run-make/metadata-flag-frobs-symbols/Makefile @@ -0,0 +1,11 @@ +# ignore-cross-compile +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/metadata-flag-frobs-symbols/bar.rs b/tests/run-make/metadata-flag-frobs-symbols/bar.rs new file mode 100644 index 000000000..1e6957a36 --- /dev/null +++ b/tests/run-make/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/metadata-flag-frobs-symbols/foo.rs b/tests/run-make/metadata-flag-frobs-symbols/foo.rs new file mode 100644 index 000000000..696aed2fa --- /dev/null +++ b/tests/run-make/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 } |