about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorJohan Lorenzo <jlorenzo@mozilla.com>2016-02-02 17:56:59 +0000
committerJohan Lorenzo <jlorenzo@mozilla.com>2016-02-11 11:14:32 +0100
commit274f27a476d48a006f8e7142d4a239f63ea2d403 (patch)
treed448d51eecf2e31e071c5acccab5dd9d69bf3523 /src/test
parentb9732ed1471689976fc32fa6757fd29c5a587f5d (diff)
downloadrust-274f27a476d48a006f8e7142d4a239f63ea2d403.tar.gz
rust-274f27a476d48a006f8e7142d4a239f63ea2d403.zip
Add -C link-dead-code option r=alexcrichton
Turning gc-sections off improves code coverage based for tools which
use DWARF debugging information (like kcov). Otherwise dead code is
stripped and kcov returns a coverage percentage that doesn't reflect
reality.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/run-make/codegen-options-parsing/Makefile7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/test/run-make/codegen-options-parsing/Makefile b/src/test/run-make/codegen-options-parsing/Makefile
index e439b27a190..c1f9065e9d2 100644
--- a/src/test/run-make/codegen-options-parsing/Makefile
+++ b/src/test/run-make/codegen-options-parsing/Makefile
@@ -22,3 +22,10 @@ all:
 	$(RUSTC) -C lto=foo dummy.rs 2>&1 | \
 		grep 'codegen option `lto` takes no value'
 	$(RUSTC) -C lto dummy.rs
+
+	# Should not link dead code...
+	$(RUSTC) -Z print-link-args dummy.rs 2>&1 | \
+		grep -e '--gc-sections\|-dead_strip\|/OPT:REF,ICF'
+	# ... unless you specifically ask to keep it
+	$(RUSTC) -Z print-link-args -C link-dead-code dummy.rs 2>&1 | \
+		(! grep -e '--gc-sections\|-dead_strip\|/OPT:REF,ICF')