summaryrefslogtreecommitdiff
path: root/test/profile/instrprof-gcov-two-objects.test
diff options
context:
space:
mode:
authorMarco Castelluccio <mcastelluccio@mozilla.com>2018-07-05 15:52:59 +0000
committerMarco Castelluccio <mcastelluccio@mozilla.com>2018-07-05 15:52:59 +0000
commit171f1837de1002d59f22d72d4794e2b7eb9c2214 (patch)
tree250e1870f681cab79319838ec5c70e006fa8bf94 /test/profile/instrprof-gcov-two-objects.test
parent8147185ac81719159a02231d2e06570bcf65617f (diff)
downloadcompiler-rt-171f1837de1002d59f22d72d4794e2b7eb9c2214.tar.gz
Make __gcov_flush flush counters for all shared libraries
Summary: This will make the behavior of __gcov_flush match the GCC behavior. I would like to rename __gcov_flush to __llvm_gcov_flush (in case of programs linking to libraries built with different compilers), but I guess we can't for compatibility reasons. Reviewers: davidxl Reviewed By: davidxl Subscribers: samsonov, vitalybuka, pcc, kcc, junbuml, glider, fhahn, eugenis, dvyukov, davidxl, srhines, chh, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D48538 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@336365 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/profile/instrprof-gcov-two-objects.test')
-rw-r--r--test/profile/instrprof-gcov-two-objects.test18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/profile/instrprof-gcov-two-objects.test b/test/profile/instrprof-gcov-two-objects.test
new file mode 100644
index 000000000..a53d51dce
--- /dev/null
+++ b/test/profile/instrprof-gcov-two-objects.test
@@ -0,0 +1,18 @@
+RUN: mkdir -p %t.d
+RUN: cd %t.d
+
+RUN: %clang --coverage -o instrprof-shared-lib.o -c %S/Inputs/instrprof-shared-lib.c
+RUN: test -f instrprof-shared-lib.gcno
+
+RUN: %clang --coverage -o instrprof-shared-main.o -c %S/Inputs/instrprof-shared-main.c
+RUN: test -f instrprof-shared-main.gcno
+
+RUN: %clang --coverage -o %t instrprof-shared-main.o instrprof-shared-lib.o
+RUN: test -f %t
+
+RUN: %run %t
+RUN: llvm-cov gcov instrprof-shared-main.gcda
+RUN: FileCheck --match-full-lines --strict-whitespace --input-file instrprof-shared-main.c.gcov %S/Inputs/instrprof-shared-main.c.gcov
+RUN: llvm-cov gcov instrprof-shared-lib.gcda
+RUN: FileCheck --match-full-lines --strict-whitespace --input-file instrprof-shared-lib.c.gcov %S/Inputs/instrprof-shared-lib_in-loop.c.gcov
+RUN: rm instrprof-shared-main.gcda instrprof-shared-lib.gcda