diff options
author | Matt Morehouse <mascasa@google.com> | 2018-07-12 20:24:58 +0000 |
---|---|---|
committer | Matt Morehouse <mascasa@google.com> | 2018-07-12 20:24:58 +0000 |
commit | 126d0f03504574c1c07be2405d4e3c08dd165b79 (patch) | |
tree | 0f3efb857aa50aa9eedec79433ef7ac7154a0c0a /test | |
parent | a1cacd32c03a747be9ccef8be8d3f35d7c3484b4 (diff) |
[SanitizerCoverage] Add associated metadata to 8-bit counters.
Summary:
This allows counters associated with unused functions to be
dead-stripped along with their functions. This approach is the same one
we used for PC tables.
Fixes an issue where LLD removes an unused PC table but leaves the 8-bit
counter.
Reviewers: eugenis
Reviewed By: eugenis
Subscribers: llvm-commits, hiraditya, kcc
Differential Revision: https://reviews.llvm.org/D49264
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@336941 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/fuzzer/gc-sections.test | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/test/fuzzer/gc-sections.test b/test/fuzzer/gc-sections.test index 7bc2f831b..b8abfbbdf 100644 --- a/test/fuzzer/gc-sections.test +++ b/test/fuzzer/gc-sections.test @@ -4,9 +4,11 @@ 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. +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 |