[compiler-rt] r336996 - Add a test with multiple BBs on the same line
Marco Castelluccio via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 13 06:01:43 PDT 2018
Author: marco
Date: Fri Jul 13 06:01:43 2018
New Revision: 336996
URL: http://llvm.org/viewvc/llvm-project?rev=336996&view=rev
Log:
Add a test with multiple BBs on the same line
Test for https://bugs.llvm.org/show_bug.cgi?id=38065.
Added:
compiler-rt/trunk/test/profile/Inputs/instrprof-gcov-multiple-bbs-single-line.c
compiler-rt/trunk/test/profile/Inputs/instrprof-gcov-multiple-bbs-single-line.c.gcov
compiler-rt/trunk/test/profile/instrprof-gcov-multiple-bbs-single-line.test
Added: compiler-rt/trunk/test/profile/Inputs/instrprof-gcov-multiple-bbs-single-line.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/profile/Inputs/instrprof-gcov-multiple-bbs-single-line.c?rev=336996&view=auto
==============================================================================
--- compiler-rt/trunk/test/profile/Inputs/instrprof-gcov-multiple-bbs-single-line.c (added)
+++ compiler-rt/trunk/test/profile/Inputs/instrprof-gcov-multiple-bbs-single-line.c Fri Jul 13 06:01:43 2018
@@ -0,0 +1,20 @@
+int main(void)
+{
+ int var;
+
+ int a = 1;
+ if (a) {
+ var++;
+ }
+
+ if (a) {}
+
+ int b = 0;
+ if (b) {
+ var++;
+ }
+
+ if (b) {}
+
+ return 0;
+}
Added: compiler-rt/trunk/test/profile/Inputs/instrprof-gcov-multiple-bbs-single-line.c.gcov
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/profile/Inputs/instrprof-gcov-multiple-bbs-single-line.c.gcov?rev=336996&view=auto
==============================================================================
--- compiler-rt/trunk/test/profile/Inputs/instrprof-gcov-multiple-bbs-single-line.c.gcov (added)
+++ compiler-rt/trunk/test/profile/Inputs/instrprof-gcov-multiple-bbs-single-line.c.gcov Fri Jul 13 06:01:43 2018
@@ -0,0 +1,34 @@
+// CHECK: -: 0:Source:{{.*}}Inputs/instrprof-gcov-multiple-bbs-single-line.c
+// CHECK-NEXT: -: 0:Graph:instrprof-gcov-multiple-bbs-single-line.gcno
+// CHECK-NEXT: -: 0:Data:instrprof-gcov-multiple-bbs-single-line.gcda
+// CHECK-NEXT: -: 0:Runs:1
+// CHECK-NEXT: -: 0:Programs:1
+// CHECK-NEXT:function main called 1 returned 100% blocks executed 80%
+// CHECK-NEXT: -: 1:int main(void)
+// CHECK-NEXT: -: 2:{
+// CHECK-NEXT: -: 3: int var;
+// CHECK-NEXT: -: 4:
+// CHECK-NEXT: 1: 5: int a = 1;
+// CHECK-NEXT: 1: 6: if (a) {
+// CHECK-NEXT:branch 0 taken 1
+// CHECK-NEXT:branch 1 taken 0
+// CHECK-NEXT: 1: 7: var++;
+// CHECK-NEXT: 1: 8: }
+// CHECK-NEXT: -: 9:
+// CHECK-NEXT: 1: 10: if (a) {}
+// CHECK-NEXT:branch 0 taken 1
+// CHECK-NEXT:branch 1 taken 0
+// CHECK-NEXT: -: 11:
+// CHECK-NEXT: 1: 12: int b = 0;
+// CHECK-NEXT: 1: 13: if (b) {
+// CHECK-NEXT:branch 0 taken 0
+// CHECK-NEXT:branch 1 taken 1
+// CHECK-NEXT: #####: 14: var++;
+// CHECK-NEXT: #####: 15: }
+// CHECK-NEXT: -: 16:
+// CHECK-NEXT: 1: 17: if (b) {}
+// CHECK-NEXT:branch 0 taken 0
+// CHECK-NEXT:branch 1 taken 1
+// CHECK-NEXT: -: 18:
+// CHECK-NEXT: 1: 19: return 0;
+// CHECK-NEXT: -: 20:}
Added: compiler-rt/trunk/test/profile/instrprof-gcov-multiple-bbs-single-line.test
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/profile/instrprof-gcov-multiple-bbs-single-line.test?rev=336996&view=auto
==============================================================================
--- compiler-rt/trunk/test/profile/instrprof-gcov-multiple-bbs-single-line.test (added)
+++ compiler-rt/trunk/test/profile/instrprof-gcov-multiple-bbs-single-line.test Fri Jul 13 06:01:43 2018
@@ -0,0 +1,13 @@
+XFAIL: *
+
+RUN: mkdir -p %t.d
+RUN: cd %t.d
+
+RUN: %clang --coverage -o %t %S/Inputs/instrprof-gcov-multiple-bbs-single-line.c
+RUN: test -f instrprof-gcov-multiple-bbs-single-line.gcno
+
+RUN: rm -f instrprof-gcov-multiple-bbs-single-line.gcda
+RUN: %run %t
+RUN: llvm-cov gcov -b -c instrprof-gcov-multiple-bbs-single-line.gcda
+RUN: FileCheck --match-full-lines --strict-whitespace --input-file instrprof-gcov-multiple-bbs-single-line.c.gcov %S/Inputs/instrprof-gcov-multiple-bbs-single-line.c.gcov
+RUN: rm instrprof-gcov-multiple-bbs-single-line.gcda
More information about the llvm-commits
mailing list