xref: /llvm-project/compiler-rt/test/fuzzer/gc-sections.test (revision 5bdb9254d92338d90b962de03bd3cd1afe9bf056)
1REQUIRES: linux, lld-available
2# LLD isn't pruning functions as we expect it to with ASAN on i386.
3UNSUPPORTED: i386
4
5No gc-sections:
6RUN: %cpp_compiler %S/GcSectionsTest.cpp -o %t
7RUN: nm %t | grep UnusedFunctionShouldBeRemovedByLinker | count 1
8
9With gc-sections. Currently, we can't remove unused code except with LLD.
10RUN: %cpp_compiler %S/GcSectionsTest.cpp -o %t -fuse-ld=lld -ffunction-sections -Wl,-gc-sections
11RUN: nm %t | not grep UnusedFunctionShouldBeRemovedByLinker
12RUN: %run %t -runs=0 2>&1 | FileCheck %s
13
14CHECK-NOT: ERROR: The size of coverage PC tables does not match
15