Skip to content

Commit cb4cd5c

Browse files
committedSep 25, 2018
[Profile] Fix gcov tests
Summary: The gcda need to be delete before running the binary to avoid to have an increasing "# of Runs" when a test is failing Reviewers: vitalybuka, eugenis, marco-c Reviewed By: marco-c Subscribers: delcypher, llvm-commits, #sanitizers, sylvestre.ledru, marco-c Differential Revision: https://reviews.llvm.org/D52456 llvm-svn: 342963
1 parent 57ddec0 commit cb4cd5c

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed
 

‎compiler-rt/test/profile/instrprof-dlopen-dlclose-gcov.test

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,18 @@ RUN: %clang --coverage -o func3.shared -fPIC -shared %S/Inputs/instrprof-dlopen-
77
RUN: %clang --coverage -o %t -fPIC -rpath %t.d %S/Inputs/instrprof-dlopen-dlclose-main.c
88

99
# Test with two dlopened libraries.
10+
RUN: rm -f instrprof-dlopen-dlclose-main.gcda instrprof-dlopen-func.gcda instrprof-dlopen-func2.gcda
1011
RUN: %run %t
1112
RUN: llvm-cov gcov instrprof-dlopen-dlclose-main.gcda
1213
RUN: FileCheck --match-full-lines --strict-whitespace --input-file instrprof-dlopen-dlclose-main.c.gcov %S/Inputs/instrprof-dlopen-dlclose-main.c.gcov
1314
RUN: llvm-cov gcov instrprof-dlopen-func.gcda
1415
RUN: FileCheck --match-full-lines --strict-whitespace --input-file instrprof-dlopen-func.c.gcov %S/Inputs/instrprof-dlopen-func.c.gcov
1516
RUN: llvm-cov gcov instrprof-dlopen-func2.gcda
1617
RUN: FileCheck --match-full-lines --strict-whitespace --input-file instrprof-dlopen-func2.c.gcov %S/Inputs/instrprof-dlopen-func2.c.gcov
17-
RUN: rm instrprof-dlopen-dlclose-main.gcda instrprof-dlopen-func.gcda instrprof-dlopen-func2.gcda
1818

1919
# Test with three dlopened libraries.
2020
RUN: %clang -DUSE_LIB3 --coverage -o %t -fPIC -rpath %t.d %S/Inputs/instrprof-dlopen-dlclose-main.c
21+
RUN: rm -f instrprof-dlopen-dlclose-main.gcda instrprof-dlopen-func.gcda instrprof-dlopen-func2.gcda instrprof-dlopen-func3.gcda
2122
RUN: %run %t
2223
RUN: llvm-cov gcov instrprof-dlopen-dlclose-main.gcda
2324
RUN: FileCheck --match-full-lines --strict-whitespace --input-file instrprof-dlopen-dlclose-main.c.gcov %S/Inputs/instrprof-dlopen-dlclose-main_three-libs.c.gcov
@@ -27,4 +28,3 @@ RUN: llvm-cov gcov instrprof-dlopen-func2.gcda
2728
RUN: FileCheck --match-full-lines --strict-whitespace --input-file instrprof-dlopen-func2.c.gcov %S/Inputs/instrprof-dlopen-func2.c.gcov
2829
RUN: llvm-cov gcov instrprof-dlopen-func3.gcda
2930
RUN: FileCheck --match-full-lines --strict-whitespace --input-file instrprof-dlopen-func2.c.gcov %S/Inputs/instrprof-dlopen-func3.c.gcov
30-
RUN: rm instrprof-dlopen-dlclose-main.gcda instrprof-dlopen-func.gcda instrprof-dlopen-func2.gcda instrprof-dlopen-func3.gcda

‎compiler-rt/test/profile/instrprof-gcov-two-objects.test

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ RUN: test -f instrprof-shared-main.gcno
1010
RUN: %clang --coverage -o %t instrprof-shared-main.o instrprof-shared-lib.o
1111
RUN: test -f %t
1212

13+
RUN: rm -f instrprof-shared-main.gcda instrprof-shared-lib.gcda
1314
RUN: %run %t
1415
RUN: llvm-cov gcov instrprof-shared-main.gcda
1516
RUN: FileCheck --match-full-lines --strict-whitespace --input-file instrprof-shared-main.c.gcov %S/Inputs/instrprof-shared-main.c.gcov
1617
RUN: llvm-cov gcov instrprof-shared-lib.gcda
1718
RUN: FileCheck --match-full-lines --strict-whitespace --input-file instrprof-shared-lib.c.gcov %S/Inputs/instrprof-shared-lib_in-loop.c.gcov
18-
RUN: rm instrprof-shared-main.gcda instrprof-shared-lib.gcda

‎compiler-rt/test/profile/instrprof-shared-gcov-flush.test

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,42 +11,42 @@ RUN: test -f instrprof-shared-lib.gcno
1111
RUN: %clang -DEXIT_ABRUPTLY -DSHARED_CALL_BEFORE_GCOV_FLUSH -DSHARED_CALL_AFTER_GCOV_FLUSH --coverage -o %t -L%t.d -rpath %t.d -lfunc %S/Inputs/instrprof-shared-main-gcov-flush.c
1212
RUN: test -f instrprof-shared-main-gcov-flush.gcno
1313

14+
RUN: rm -f instrprof-shared-main-gcov-flush.gcda instrprof-shared-lib.gcda
1415
RUN: %run %t
1516
RUN: llvm-cov gcov instrprof-shared-main-gcov-flush.gcda
1617
RUN: FileCheck --match-full-lines --strict-whitespace --input-file instrprof-shared-main-gcov-flush.c.gcov %S/Inputs/instrprof-shared-main-gcov-flush_no-writeout.c.gcov
1718
RUN: llvm-cov gcov instrprof-shared-lib.gcda
1819
RUN: FileCheck --match-full-lines --strict-whitespace --input-file instrprof-shared-lib.c.gcov %S/Inputs/instrprof-shared-lib.c.gcov
19-
RUN: rm instrprof-shared-main-gcov-flush.gcda instrprof-shared-lib.gcda
2020

2121
# Test the case where we exit normally and we have a call to the shared library function before __gcov_flush.
2222
RUN: %clang -DSHARED_CALL_BEFORE_GCOV_FLUSH --coverage -o %t -L%t.d -rpath %t.d -lfunc %S/Inputs/instrprof-shared-main-gcov-flush.c
2323
RUN: test -f instrprof-shared-main-gcov-flush.gcno
2424

25+
RUN: rm -f instrprof-shared-main-gcov-flush.gcda instrprof-shared-lib.gcda
2526
RUN: %run %t
2627
RUN: llvm-cov gcov instrprof-shared-main-gcov-flush.gcda
2728
RUN: FileCheck --match-full-lines --strict-whitespace --input-file instrprof-shared-main-gcov-flush.c.gcov %S/Inputs/instrprof-shared-main-gcov-flush_shared-call-before.c.gcov
2829
RUN: llvm-cov gcov instrprof-shared-lib.gcda
2930
RUN: FileCheck --match-full-lines --strict-whitespace --input-file instrprof-shared-lib.c.gcov %S/Inputs/instrprof-shared-lib.c.gcov
30-
RUN: rm instrprof-shared-main-gcov-flush.gcda instrprof-shared-lib.gcda
3131

3232
# Test the case where we exit normally and we have a call to the shared library function after __gcov_flush.
3333
RUN: %clang -DSHARED_CALL_AFTER_GCOV_FLUSH --coverage -o %t -L%t.d -rpath %t.d -lfunc %S/Inputs/instrprof-shared-main-gcov-flush.c
3434
RUN: test -f instrprof-shared-main-gcov-flush.gcno
3535

36+
RUN: rm -f instrprof-shared-main-gcov-flush.gcda instrprof-shared-lib.gcda
3637
RUN: %run %t
3738
RUN: llvm-cov gcov instrprof-shared-main-gcov-flush.gcda
3839
RUN: FileCheck --match-full-lines --strict-whitespace --input-file instrprof-shared-main-gcov-flush.c.gcov %S/Inputs/instrprof-shared-main-gcov-flush_shared-call-after.c.gcov
3940
RUN: llvm-cov gcov instrprof-shared-lib.gcda
4041
RUN: FileCheck --match-full-lines --strict-whitespace --input-file instrprof-shared-lib.c.gcov %S/Inputs/instrprof-shared-lib.c.gcov
41-
RUN: rm instrprof-shared-main-gcov-flush.gcda instrprof-shared-lib.gcda
4242

4343
# Test the case where we exit normally and we have calls to the shared library function before and after __gcov_flush.
4444
RUN: %clang -DSHARED_CALL_BEFORE_GCOV_FLUSH -DSHARED_CALL_AFTER_GCOV_FLUSH --coverage -o %t -L%t.d -rpath %t.d -lfunc %S/Inputs/instrprof-shared-main-gcov-flush.c
4545
RUN: test -f instrprof-shared-main-gcov-flush.gcno
4646

47+
RUN: rm -f instrprof-shared-main-gcov-flush.gcda instrprof-shared-lib.gcda
4748
RUN: %run %t
4849
RUN: llvm-cov gcov instrprof-shared-main-gcov-flush.gcda
4950
RUN: FileCheck --match-full-lines --strict-whitespace --input-file instrprof-shared-main-gcov-flush.c.gcov %S/Inputs/instrprof-shared-main-gcov-flush_shared-call-before-after.c.gcov
5051
RUN: llvm-cov gcov instrprof-shared-lib.gcda
5152
RUN: FileCheck --match-full-lines --strict-whitespace --input-file instrprof-shared-lib.c.gcov %S/Inputs/instrprof-shared-lib_called-twice.c.gcov
52-
RUN: rm instrprof-shared-main-gcov-flush.gcda instrprof-shared-lib.gcda

0 commit comments

Comments
 (0)
Please sign in to comment.