summaryrefslogtreecommitdiffstats
path: root/tests/run-make/allocator-shim-circular-deps
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-18 02:49:50 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-18 02:49:50 +0000
commit9835e2ae736235810b4ea1c162ca5e65c547e770 (patch)
tree3fcebf40ed70e581d776a8a4c65923e8ec20e026 /tests/run-make/allocator-shim-circular-deps
parentReleasing progress-linux version 1.70.0+dfsg2-1~progress7.99u1. (diff)
downloadrustc-9835e2ae736235810b4ea1c162ca5e65c547e770.tar.xz
rustc-9835e2ae736235810b4ea1c162ca5e65c547e770.zip
Merging upstream version 1.71.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/run-make/allocator-shim-circular-deps')
-rw-r--r--tests/run-make/allocator-shim-circular-deps/Makefile7
-rw-r--r--tests/run-make/allocator-shim-circular-deps/main.rs5
-rw-r--r--tests/run-make/allocator-shim-circular-deps/my_lib.rs10
3 files changed, 22 insertions, 0 deletions
diff --git a/tests/run-make/allocator-shim-circular-deps/Makefile b/tests/run-make/allocator-shim-circular-deps/Makefile
new file mode 100644
index 000000000..4624b8468
--- /dev/null
+++ b/tests/run-make/allocator-shim-circular-deps/Makefile
@@ -0,0 +1,7 @@
+# ignore-cross-compile
+include ../tools.mk
+
+all:
+ rm -rf $(TMPDIR) && mkdir $(TMPDIR)
+ $(RUSTC) my_lib.rs
+ $(RUSTC) main.rs --test --extern my_lib=$(TMPDIR)/libmy_lib.rlib
diff --git a/tests/run-make/allocator-shim-circular-deps/main.rs b/tests/run-make/allocator-shim-circular-deps/main.rs
new file mode 100644
index 000000000..e317c6571
--- /dev/null
+++ b/tests/run-make/allocator-shim-circular-deps/main.rs
@@ -0,0 +1,5 @@
+#![crate_type = "bin"]
+
+fn main() {
+ my_lib::do_something();
+}
diff --git a/tests/run-make/allocator-shim-circular-deps/my_lib.rs b/tests/run-make/allocator-shim-circular-deps/my_lib.rs
new file mode 100644
index 000000000..095b10361
--- /dev/null
+++ b/tests/run-make/allocator-shim-circular-deps/my_lib.rs
@@ -0,0 +1,10 @@
+#![crate_type = "lib"]
+
+use std::alloc::System;
+
+#[global_allocator]
+static ALLOCATOR: System = System;
+
+pub fn do_something() {
+ format!("allocating a string!");
+}