[compiler-rt] r348187 - [gcov/Darwin] Ensure external symbols are exported when using an export list

Vedant Kumar via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 3 12:53:59 PST 2018


Author: vedantk
Date: Mon Dec  3 12:53:58 2018
New Revision: 348187

URL: http://llvm.org/viewvc/llvm-project?rev=348187&view=rev
Log:
[gcov/Darwin] Ensure external symbols are exported when using an export list

Make sure that symbols needed to implement runtime support for gcov are
exported when using an export list on Darwin.

Without the clang driver exporting these symbols, the linker hides them,
resulting in tapi verification failures.

rdar://45944768

Differential Revision: https://reviews.llvm.org/D55151

Modified:
    compiler-rt/trunk/test/profile/instrprof-darwin-exports.c

Modified: compiler-rt/trunk/test/profile/instrprof-darwin-exports.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/profile/instrprof-darwin-exports.c?rev=348187&r1=348186&r2=348187&view=diff
==============================================================================
--- compiler-rt/trunk/test/profile/instrprof-darwin-exports.c (original)
+++ compiler-rt/trunk/test/profile/instrprof-darwin-exports.c Mon Dec  3 12:53:58 2018
@@ -8,6 +8,9 @@
 // RUN: %clang_profgen -Werror -fcoverage-mapping -Wl,-exported_symbols_list,%t.exports -o %t %s 2>&1 | tee -a %t.log
 // RUN: cat %t.log | count 0
 
+// RUN: %clang -Werror -Wl,-exported_symbols_list,%t.exports --coverage -o %t.gcov %s | tee -a %t.gcov.log
+// RUN: cat %t.gcov.log | count 0
+
 // The default set of weak external symbols should match the set of symbols
 // exported by clang. See Darwin::addProfileRTLibs.
 
@@ -16,4 +19,9 @@
 // RUN: nm -jUg %t > %t.clang.exports
 // RUN: diff %t.default.exports %t.clang.exports
 
+// RUN: %clang -Werror --coverage -o %t.gcov.default %s
+// RUN: nm -jUg %t.gcov | grep -v __mh_execute_header > %t.gcov.exports
+// RUN: nm -jUg %t.gcov.default | grep -v __mh_execute_header > %t.gcov.default.exports
+// RUN: diff %t.gcov.default.exports %t.gcov.exports
+
 int main() {}




More information about the llvm-commits mailing list