aboutsummaryrefslogtreecommitdiff
path: root/test/fuzzer/gc-sections.test
diff options
context:
space:
mode:
Diffstat (limited to 'test/fuzzer/gc-sections.test')
-rw-r--r--test/fuzzer/gc-sections.test10
1 files changed, 6 insertions, 4 deletions
diff --git a/test/fuzzer/gc-sections.test b/test/fuzzer/gc-sections.test
index 8785bb00ec1b..b8abfbbdf17b 100644
--- a/test/fuzzer/gc-sections.test
+++ b/test/fuzzer/gc-sections.test
@@ -1,12 +1,14 @@
-REQUIRES: linux
+REQUIRES: linux, lld-available
No gc-sections:
RUN: %cpp_compiler %S/GcSectionsTest.cpp -o %t
RUN: nm %t | grep UnusedFunctionShouldBeRemovedByLinker | count 1
-With gc-sections. Currently, we can't remove unused code.
-DISABLED: %cpp_compiler %S/GcSectionsTest.cpp -o %t -ffunction-sections -Wl,-gc-sections
-DISABLED: nm %t | grep UnusedFunctionShouldBeRemovedByLinker | count 1
+With gc-sections. Currently, we can't remove unused code except with LLD.
+RUN: %cpp_compiler %S/GcSectionsTest.cpp -o %t -fuse-ld=lld -ffunction-sections -Wl,-gc-sections
+RUN: nm %t | not grep UnusedFunctionShouldBeRemovedByLinker
+RUN: %run %t -runs=0 2>&1 | FileCheck %s
+CHECK-NOT: ERROR: The size of coverage PC tables does not match
With gc sections, with trace-pc. Unused code is removed.
RUN: %cpp_compiler %S/GcSectionsTest.cpp -o %t -fsanitize-coverage=0 -fsanitize-coverage=trace-pc -ffunction-sections -Wl,-gc-sections