summaryrefslogtreecommitdiffstats
path: root/tests/run-make/allocator-shim-circular-deps
diff options
context:
space:
mode:
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!");
+}