[PATCH] D49460: Flush counters before forking to avoid counting the execution before fork twice

David Li via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 18 11:52:22 PDT 2018


davidxl added inline comments.


================
Comment at: test/profile/Inputs/instrprof-gcov-fork.c.gcov:9
+// CHECK-NEXT:function func1 called 1 returned 100% blocks executed 100%
+// CHECK-NEXT:        2:    3:void func1() {}
+// CHECK-NEXT:function func2 called 2 returned 100% blocks executed 100%
----------------
func1 is executed once not twice.


================
Comment at: test/profile/Inputs/instrprof-gcov-fork.c.gcov:11
+// CHECK-NEXT:function func2 called 2 returned 100% blocks executed 100%
+// CHECK-NEXT:        4:    4:void func2() {}
+// CHECK-NEXT:        -:    5:
----------------
func2 is executed twice not 4 times.


================
Comment at: test/profile/Inputs/instrprof-gcov-fork.c.gcov:20
+// CHECK-NEXT:        -:   11:
+// CHECK-NEXT:        1:   12:  func2();
+// CHECK-NEXT:        -:   13:
----------------
this line should be executed twice.


================
Comment at: test/profile/Inputs/instrprof-gcov-fork.c.gcov:22
+// CHECK-NEXT:        -:   13:
+// CHECK-NEXT:        1:   14:  return 0;
+// CHECK-NEXT:        -:   15:}
----------------
same here.


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D49460





More information about the llvm-commits mailing list