blob: 8785bb00ec1ba3fe714bd8ce84da35a1a883a664 [file] [log] [blame]
Kostya Serebryany80e9a6c2017-09-15 23:07:18 +00001REQUIRES: linux
2
3No gc-sections:
4RUN: %cpp_compiler %S/GcSectionsTest.cpp -o %t
5RUN: nm %t | grep UnusedFunctionShouldBeRemovedByLinker | count 1
6
7With gc-sections. Currently, we can't remove unused code.
8DISABLED: %cpp_compiler %S/GcSectionsTest.cpp -o %t -ffunction-sections -Wl,-gc-sections
9DISABLED: nm %t | grep UnusedFunctionShouldBeRemovedByLinker | count 1
10
11With gc sections, with trace-pc. Unused code is removed.
12RUN: %cpp_compiler %S/GcSectionsTest.cpp -o %t -fsanitize-coverage=0 -fsanitize-coverage=trace-pc -ffunction-sections -Wl,-gc-sections
13RUN: nm %t | not grep UnusedFunctionShouldBeRemovedByLinker