[compiler-rt] r342963 - [Profile] Fix gcov tests

Calixte Denizet via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 25 04:12:15 PDT 2018


Author: calixte
Date: Tue Sep 25 04:12:15 2018
New Revision: 342963

URL: http://llvm.org/viewvc/llvm-project?rev=342963&view=rev
Log:
[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

Modified:
    compiler-rt/trunk/test/profile/instrprof-dlopen-dlclose-gcov.test
    compiler-rt/trunk/test/profile/instrprof-gcov-two-objects.test
    compiler-rt/trunk/test/profile/instrprof-shared-gcov-flush.test

Modified: compiler-rt/trunk/test/profile/instrprof-dlopen-dlclose-gcov.test
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/profile/instrprof-dlopen-dlclose-gcov.test?rev=342963&r1=342962&r2=342963&view=diff
==============================================================================
--- compiler-rt/trunk/test/profile/instrprof-dlopen-dlclose-gcov.test (original)
+++ compiler-rt/trunk/test/profile/instrprof-dlopen-dlclose-gcov.test Tue Sep 25 04:12:15 2018
@@ -7,6 +7,7 @@ RUN: %clang --coverage -o func3.shared -
 RUN: %clang --coverage -o %t -fPIC -rpath %t.d %S/Inputs/instrprof-dlopen-dlclose-main.c
 
 # Test with two dlopened libraries.
+RUN: rm -f instrprof-dlopen-dlclose-main.gcda instrprof-dlopen-func.gcda instrprof-dlopen-func2.gcda
 RUN: %run %t
 RUN: llvm-cov gcov instrprof-dlopen-dlclose-main.gcda
 RUN: FileCheck --match-full-lines --strict-whitespace --input-file instrprof-dlopen-dlclose-main.c.gcov %S/Inputs/instrprof-dlopen-dlclose-main.c.gcov
@@ -14,10 +15,10 @@ RUN: llvm-cov gcov instrprof-dlopen-func
 RUN: FileCheck --match-full-lines --strict-whitespace --input-file instrprof-dlopen-func.c.gcov %S/Inputs/instrprof-dlopen-func.c.gcov
 RUN: llvm-cov gcov instrprof-dlopen-func2.gcda
 RUN: FileCheck --match-full-lines --strict-whitespace --input-file instrprof-dlopen-func2.c.gcov %S/Inputs/instrprof-dlopen-func2.c.gcov
-RUN: rm instrprof-dlopen-dlclose-main.gcda instrprof-dlopen-func.gcda instrprof-dlopen-func2.gcda
 
 # Test with three dlopened libraries.
 RUN: %clang -DUSE_LIB3 --coverage -o %t -fPIC -rpath %t.d %S/Inputs/instrprof-dlopen-dlclose-main.c
+RUN: rm -f instrprof-dlopen-dlclose-main.gcda instrprof-dlopen-func.gcda instrprof-dlopen-func2.gcda instrprof-dlopen-func3.gcda
 RUN: %run %t
 RUN: llvm-cov gcov instrprof-dlopen-dlclose-main.gcda
 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-func
 RUN: FileCheck --match-full-lines --strict-whitespace --input-file instrprof-dlopen-func2.c.gcov %S/Inputs/instrprof-dlopen-func2.c.gcov
 RUN: llvm-cov gcov instrprof-dlopen-func3.gcda
 RUN: FileCheck --match-full-lines --strict-whitespace --input-file instrprof-dlopen-func2.c.gcov %S/Inputs/instrprof-dlopen-func3.c.gcov
-RUN: rm instrprof-dlopen-dlclose-main.gcda instrprof-dlopen-func.gcda instrprof-dlopen-func2.gcda instrprof-dlopen-func3.gcda

Modified: compiler-rt/trunk/test/profile/instrprof-gcov-two-objects.test
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/profile/instrprof-gcov-two-objects.test?rev=342963&r1=342962&r2=342963&view=diff
==============================================================================
--- compiler-rt/trunk/test/profile/instrprof-gcov-two-objects.test (original)
+++ compiler-rt/trunk/test/profile/instrprof-gcov-two-objects.test Tue Sep 25 04:12:15 2018
@@ -10,9 +10,9 @@ 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: rm -f instrprof-shared-main.gcda instrprof-shared-lib.gcda
 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

Modified: compiler-rt/trunk/test/profile/instrprof-shared-gcov-flush.test
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/profile/instrprof-shared-gcov-flush.test?rev=342963&r1=342962&r2=342963&view=diff
==============================================================================
--- compiler-rt/trunk/test/profile/instrprof-shared-gcov-flush.test (original)
+++ compiler-rt/trunk/test/profile/instrprof-shared-gcov-flush.test Tue Sep 25 04:12:15 2018
@@ -11,42 +11,42 @@ RUN: test -f instrprof-shared-lib.gcno
 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
 RUN: test -f instrprof-shared-main-gcov-flush.gcno
 
+RUN: rm -f instrprof-shared-main-gcov-flush.gcda instrprof-shared-lib.gcda
 RUN: %run %t
 RUN: llvm-cov gcov instrprof-shared-main-gcov-flush.gcda
 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
 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.c.gcov
-RUN: rm instrprof-shared-main-gcov-flush.gcda instrprof-shared-lib.gcda
 
 # Test the case where we exit normally and we have a call to the shared library function before __gcov_flush.
 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
 RUN: test -f instrprof-shared-main-gcov-flush.gcno
 
+RUN: rm -f instrprof-shared-main-gcov-flush.gcda instrprof-shared-lib.gcda
 RUN: %run %t
 RUN: llvm-cov gcov instrprof-shared-main-gcov-flush.gcda
 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
 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.c.gcov
-RUN: rm instrprof-shared-main-gcov-flush.gcda instrprof-shared-lib.gcda
 
 # Test the case where we exit normally and we have a call to the shared library function after __gcov_flush.
 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
 RUN: test -f instrprof-shared-main-gcov-flush.gcno
 
+RUN: rm -f instrprof-shared-main-gcov-flush.gcda instrprof-shared-lib.gcda
 RUN: %run %t
 RUN: llvm-cov gcov instrprof-shared-main-gcov-flush.gcda
 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
 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.c.gcov
-RUN: rm instrprof-shared-main-gcov-flush.gcda instrprof-shared-lib.gcda
 
 # Test the case where we exit normally and we have calls to the shared library function before and after __gcov_flush.
 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
 RUN: test -f instrprof-shared-main-gcov-flush.gcno
 
+RUN: rm -f instrprof-shared-main-gcov-flush.gcda instrprof-shared-lib.gcda
 RUN: %run %t
 RUN: llvm-cov gcov instrprof-shared-main-gcov-flush.gcda
 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
 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_called-twice.c.gcov
-RUN: rm instrprof-shared-main-gcov-flush.gcda instrprof-shared-lib.gcda




More information about the llvm-commits mailing list