4 RUN: %cpp_compiler %S/GcSectionsTest.cpp -o %t
5 RUN: nm %t | grep UnusedFunctionShouldBeRemovedByLinker | count 1
7 With gc-sections. Currently, we can't remove unused code.
8 DISABLED: %cpp_compiler %S/GcSectionsTest.cpp -o %t -ffunction-sections -Wl,-gc-sections
9 DISABLED: nm %t | grep UnusedFunctionShouldBeRemovedByLinker | count 1
11 With gc sections, with trace-pc. Unused code is removed.
12 RUN: %cpp_compiler %S/GcSectionsTest.cpp -o %t -fsanitize-coverage=0 -fsanitize-coverage=trace-pc -ffunction-sections -Wl,-gc-sections
13 RUN: nm %t | not grep UnusedFunctionShouldBeRemovedByLinker