[PATCH] D53601: [GCOV] Add a test for function defined on one line (follow-up of https://reviews.llvm.org/D53600)

calixte via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 30 11:43:59 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rCRT345625: [GCOV] Add a test for function defined on one line (follow-up of https… (authored by calixte, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D53601?vs=170722&id=171746#toc

Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D53601

Files:
  test/profile/Inputs/instrprof-gcov-one-line-function.c
  test/profile/Inputs/instrprof-gcov-one-line-function.c.gcov
  test/profile/instrprof-gcov-one-line-function.test


Index: test/profile/Inputs/instrprof-gcov-one-line-function.c
===================================================================
--- test/profile/Inputs/instrprof-gcov-one-line-function.c
+++ test/profile/Inputs/instrprof-gcov-one-line-function.c
@@ -0,0 +1,11 @@
+void foo() { }
+
+void bar() { }
+
+int main(void) {
+    foo();
+
+    bar();
+
+    return 0;
+}
Index: test/profile/Inputs/instrprof-gcov-one-line-function.c.gcov
===================================================================
--- test/profile/Inputs/instrprof-gcov-one-line-function.c.gcov
+++ test/profile/Inputs/instrprof-gcov-one-line-function.c.gcov
@@ -0,0 +1,16 @@
+// CHECK:        -:    0:Source:/home/calixte/dev/mozilla/llvm.cal/projects/compiler-rt/test/profile/Inputs/instrprof-gcov-one-line-function.c
+// CHECK-NEXT:        -:    0:Graph:instrprof-gcov-one-line-function.gcno
+// CHECK-NEXT:        -:    0:Data:instrprof-gcov-one-line-function.gcda
+// CHECK-NEXT:        -:    0:Runs:1
+// CHECK-NEXT:        -:    0:Programs:1
+// CHECK-NEXT:        1:    1:void foo() { }
+// CHECK-NEXT:        -:    2:
+// CHECK-NEXT:        1:    3:void bar() { }
+// CHECK-NEXT:        -:    4:
+// CHECK-NEXT:        1:    5:int main(void) {
+// CHECK-NEXT:        1:    6:    foo();
+// CHECK-NEXT:        -:    7:
+// CHECK-NEXT:        1:    8:    bar();
+// CHECK-NEXT:        -:    9:
+// CHECK-NEXT:        1:   10:    return 0;
+// CHECK-NEXT:        -:   11:}
Index: test/profile/instrprof-gcov-one-line-function.test
===================================================================
--- test/profile/instrprof-gcov-one-line-function.test
+++ test/profile/instrprof-gcov-one-line-function.test
@@ -0,0 +1,9 @@
+RUN: mkdir -p %t.d
+RUN: cd %t.d
+
+RUN: %clang --coverage -o %t %S/Inputs/instrprof-gcov-one-line-function.c
+RUN: test -f instrprof-gcov-one-line-function.gcno
+RUN: rm -f instrprof-gcov-one-line-function.gcda
+RUN: %run %t
+RUN: llvm-cov gcov instrprof-gcov-one-line-function.gcda
+RUN: FileCheck --match-full-lines --strict-whitespace --input-file instrprof-gcov-one-line-function.c.gcov %S/Inputs/instrprof-gcov-one-line-function.c.gcov


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D53601.171746.patch
Type: text/x-patch
Size: 2143 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181030/fe628c9c/attachment.bin>


More information about the llvm-commits mailing list