summaryrefslogtreecommitdiffstats
path: root/tests/run-make/no-builtins-lto/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'tests/run-make/no-builtins-lto/Makefile')
-rw-r--r--tests/run-make/no-builtins-lto/Makefile9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/run-make/no-builtins-lto/Makefile b/tests/run-make/no-builtins-lto/Makefile
new file mode 100644
index 000000000..c8f05d991
--- /dev/null
+++ b/tests/run-make/no-builtins-lto/Makefile
@@ -0,0 +1,9 @@
+include ../tools.mk
+
+all:
+ # Compile a `#![no_builtins]` rlib crate
+ $(RUSTC) no_builtins.rs
+ # Build an executable that depends on that crate using LTO. The no_builtins crate doesn't
+ # participate in LTO, so its rlib must be explicitly linked into the final binary. Verify this by
+ # grepping the linker arguments.
+ $(RUSTC) main.rs -C lto --print link-args | $(CGREP) 'libno_builtins.rlib'