[libc] Switch to using the generic `<gpuintrin.h>` implementations (#121810)
[llvm-project.git] / compiler-rt / test / profile / instrprof-darwin-exports.c
blob079d5d28ed24d9b96ae4a730de0e7208b0d99323
1 // REQUIRES: osx-ld64-live_support
3 // Compiling with PGO/code coverage on Darwin should raise no warnings or errors
4 // when using an exports list.
6 // 1) Check that using PGO/code coverage flags with an export list containing
7 // just "_main" produces no warnings or errors.
8 //
9 // RUN: echo "_main" > %t.exports
10 // RUN: %clang_pgogen -Werror -Wl,-exported_symbols_list,%t.exports -o %t %s 2>&1 | tee %t.log
11 // RUN: %clang_profgen -Werror -fcoverage-mapping -Wl,-exported_symbols_list,%t.exports -o %t %s 2>&1 | tee -a %t.log
12 // RUN: cat %t.log | count 0
14 // 2) Ditto (1), but for GCOV.
16 // RUN: %clang -Werror -Wl,-exported_symbols_list,%t.exports --coverage -o %t.gcov %s | tee -a %t.gcov.log
17 // RUN: cat %t.gcov.log | count 0
19 // 3) The default set of weak external symbols should match the set of symbols
20 // exported by clang. See Darwin::addProfileRTLibs. This requirement was put in
21 // place to support tapi binary verification.
23 // RUN: %clang_pgogen -Werror -o %t.default %s
24 // RUN: nm -jUg %t.default | grep -v __mh_execute_header > %t.default.exports
25 // RUN: nm -jUg %t | grep -v __mh_execute_header > %t.clang.exports
26 // RUN: diff %t.default.exports %t.clang.exports
28 // 4) Ditto (3), but for GCOV.
30 // RUN: %clang -Werror --coverage -o %t.gcov.default %s
31 // RUN: nm -jUg %t.gcov | grep -v __mh_execute_header > %t.gcov.exports
32 // RUN: nm -jUg %t.gcov.default | grep -v __mh_execute_header > %t.gcov.default.exports
33 // RUN: diff %t.gcov.default.exports %t.gcov.exports
35 int main() {}