[compiler-rt] r337150 - Add a test with __gcov_flush called before terminating the program.
Marco Castelluccio via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 16 02:13:46 PDT 2018
Author: marco
Date: Mon Jul 16 02:13:46 2018
New Revision: 337150
URL: http://llvm.org/viewvc/llvm-project?rev=337150&view=rev
Log:
Add a test with __gcov_flush called before terminating the program.
Test for https://bugs.llvm.org/show_bug.cgi?id=38067.
Added:
compiler-rt/trunk/test/profile/Inputs/instrprof-gcov-__gcov_flush-terminate.c
compiler-rt/trunk/test/profile/Inputs/instrprof-gcov-__gcov_flush-terminate.c.gcov
compiler-rt/trunk/test/profile/instrprof-gcov-__gcov_flush-terminate.test
Added: compiler-rt/trunk/test/profile/Inputs/instrprof-gcov-__gcov_flush-terminate.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/profile/Inputs/instrprof-gcov-__gcov_flush-terminate.c?rev=337150&view=auto
==============================================================================
--- compiler-rt/trunk/test/profile/Inputs/instrprof-gcov-__gcov_flush-terminate.c (added)
+++ compiler-rt/trunk/test/profile/Inputs/instrprof-gcov-__gcov_flush-terminate.c Mon Jul 16 02:13:46 2018
@@ -0,0 +1,13 @@
+int main(void) {
+ int i = 22;
+
+ __gcov_flush();
+
+ i = 42;
+
+ asm("int $3");
+
+ i = 84;
+
+ return 0;
+}
Added: compiler-rt/trunk/test/profile/Inputs/instrprof-gcov-__gcov_flush-terminate.c.gcov
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/profile/Inputs/instrprof-gcov-__gcov_flush-terminate.c.gcov?rev=337150&view=auto
==============================================================================
--- compiler-rt/trunk/test/profile/Inputs/instrprof-gcov-__gcov_flush-terminate.c.gcov (added)
+++ compiler-rt/trunk/test/profile/Inputs/instrprof-gcov-__gcov_flush-terminate.c.gcov Mon Jul 16 02:13:46 2018
@@ -0,0 +1,18 @@
+// CHECK: -: 0:Source:{{.*}}Inputs/instrprof-gcov-__gcov_flush-terminate.c
+// CHECK-NEXT: -: 0:Graph:instrprof-gcov-__gcov_flush-terminate.gcno
+// CHECK-NEXT: -: 0:Data:instrprof-gcov-__gcov_flush-terminate.gcda
+// CHECK-NEXT: -: 0:Runs:1
+// CHECK-NEXT: -: 0:Programs:1
+// CHECK-NEXT: -: 1:int main(void) {
+// CHECK-NEXT: 1: 2: int i = 22;
+// CHECK-NEXT: -: 3:
+// CHECK-NEXT: 1: 4: __gcov_flush();
+// CHECK-NEXT: -: 5:
+// CHECK-NEXT: #####: 6: i = 42;
+// CHECK-NEXT: -: 7:
+// CHECK-NEXT: #####: 8: asm("int $3");
+// CHECK-NEXT: -: 9:
+// CHECK-NEXT: #####: 10: i = 84;
+// CHECK-NEXT: -: 11:
+// CHECK-NEXT: #####: 12: return 0;
+// CHECK-NEXT: -: 13:}
Added: compiler-rt/trunk/test/profile/instrprof-gcov-__gcov_flush-terminate.test
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/profile/instrprof-gcov-__gcov_flush-terminate.test?rev=337150&view=auto
==============================================================================
--- compiler-rt/trunk/test/profile/instrprof-gcov-__gcov_flush-terminate.test (added)
+++ compiler-rt/trunk/test/profile/instrprof-gcov-__gcov_flush-terminate.test Mon Jul 16 02:13:46 2018
@@ -0,0 +1,12 @@
+XFAIL: *
+
+RUN: mkdir -p %t.d
+RUN: cd %t.d
+
+RUN: %clang --coverage -o %t %S/Inputs/instrprof-gcov-__gcov_flush-terminate.c
+RUN: test -f instrprof-gcov-__gcov_flush-terminate.gcno
+
+RUN: rm -f instrprof-gcov-__gcov_flush-terminate.gcda
+RUN: %expect_crash %run %t
+RUN: llvm-cov gcov instrprof-gcov-__gcov_flush-terminate.gcda
+RUN: FileCheck --match-full-lines --strict-whitespace --input-file instrprof-gcov-__gcov_flush-terminate.c.gcov %S/Inputs/instrprof-gcov-__gcov_flush-terminate.c.gcov
More information about the llvm-commits
mailing list