From 589fff9c71b37ddcf17942b07f61bfc95ae07dd5 Mon Sep 17 00:00:00 2001 From: Calixte Denizet Date: Thu, 11 Oct 2018 08:53:55 +0000 Subject: [PATCH] [profile] Fix the gcov tests after the patch in D49853 landed. Summary: The goal of the patch in D49853 is to display counter on the line of function definition. So some tests need to be fixed. Reviewers: marco-c, davidxl Reviewed By: marco-c Subscribers: sylvestre.ledru, delcypher, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D49854 llvm-svn: 344229 --- .../test/profile/Inputs/instrprof-dlopen-dlclose-main.c.gcov | 2 +- .../Inputs/instrprof-dlopen-dlclose-main_three-libs.c.gcov | 2 +- .../test/profile/Inputs/instrprof-gcov-exceptions.cpp.gcov | 4 ++-- .../Inputs/instrprof-gcov-multiple-bbs-single-line.c.gcov | 2 +- compiler-rt/test/profile/Inputs/instrprof-gcov-switch1.c.gcov | 2 +- compiler-rt/test/profile/Inputs/instrprof-gcov-switch2.c.gcov | 2 +- compiler-rt/test/profile/Inputs/instrprof-shared-lib.c.gcov | 2 +- .../profile/Inputs/instrprof-shared-lib_called-twice.c.gcov | 2 +- .../test/profile/Inputs/instrprof-shared-lib_in-loop.c.gcov | 2 +- .../instrprof-shared-main-gcov-flush_no-writeout.c.gcov | 4 ++-- .../instrprof-shared-main-gcov-flush_shared-call-after.c.gcov | 4 ++-- ...rof-shared-main-gcov-flush_shared-call-before-after.c.gcov | 4 ++-- ...instrprof-shared-main-gcov-flush_shared-call-before.c.gcov | 4 ++-- compiler-rt/test/profile/Inputs/instrprof-shared-main.c.gcov | 2 +- 14 files changed, 19 insertions(+), 19 deletions(-) diff --git a/compiler-rt/test/profile/Inputs/instrprof-dlopen-dlclose-main.c.gcov b/compiler-rt/test/profile/Inputs/instrprof-dlopen-dlclose-main.c.gcov index acb2076fd763..2d538f63eb46 100644 --- a/compiler-rt/test/profile/Inputs/instrprof-dlopen-dlclose-main.c.gcov +++ b/compiler-rt/test/profile/Inputs/instrprof-dlopen-dlclose-main.c.gcov @@ -7,7 +7,7 @@ // CHECK-NEXT: -: 2:#include // CHECK-NEXT: -: 3:#include // CHECK-NEXT: -: 4: -// CHECK-NEXT: -: 5:int main(int argc, char *argv[]) { +// CHECK-NEXT: 1: 5:int main(int argc, char *argv[]) { // CHECK-NEXT: 1: 6: dlerror(); // CHECK-NEXT: 1: 7: void *f1_handle = dlopen("func.shared", RTLD_LAZY | RTLD_GLOBAL); // CHECK-NEXT: 1: 8: if (f1_handle == NULL) { diff --git a/compiler-rt/test/profile/Inputs/instrprof-dlopen-dlclose-main_three-libs.c.gcov b/compiler-rt/test/profile/Inputs/instrprof-dlopen-dlclose-main_three-libs.c.gcov index 97eef4c3b905..f1dd1757144f 100644 --- a/compiler-rt/test/profile/Inputs/instrprof-dlopen-dlclose-main_three-libs.c.gcov +++ b/compiler-rt/test/profile/Inputs/instrprof-dlopen-dlclose-main_three-libs.c.gcov @@ -7,7 +7,7 @@ // CHECK-NEXT: -: 2:#include // CHECK-NEXT: -: 3:#include // CHECK-NEXT: -: 4: -// CHECK-NEXT: -: 5:int main(int argc, char *argv[]) { +// CHECK-NEXT: 1: 5:int main(int argc, char *argv[]) { // CHECK-NEXT: 1: 6: dlerror(); // CHECK-NEXT: 1: 7: void *f1_handle = dlopen("func.shared", RTLD_LAZY | RTLD_GLOBAL); // CHECK-NEXT: 1: 8: if (f1_handle == NULL) { diff --git a/compiler-rt/test/profile/Inputs/instrprof-gcov-exceptions.cpp.gcov b/compiler-rt/test/profile/Inputs/instrprof-gcov-exceptions.cpp.gcov index 2a7b724887d5..f8e38297475d 100644 --- a/compiler-rt/test/profile/Inputs/instrprof-gcov-exceptions.cpp.gcov +++ b/compiler-rt/test/profile/Inputs/instrprof-gcov-exceptions.cpp.gcov @@ -5,10 +5,10 @@ // CHECK-NEXT: -: 0:Programs:1 // CHECK-NEXT: -: 1:#include // CHECK-NEXT: -: 2: -// CHECK-NEXT: -: 3:void asd(std::string i) { +// CHECK-NEXT: 1: 3:void asd(std::string i) { // CHECK-NEXT: 1: 4:} // CHECK-NEXT: -: 5: -// CHECK-NEXT: -: 6:int main(void) +// CHECK-NEXT: 1: 6:int main(void) // CHECK-NEXT: -: 7:{ // CHECK-NEXT: 1: 8: asd("22"); // CHECK-NEXT: -: 9: diff --git a/compiler-rt/test/profile/Inputs/instrprof-gcov-multiple-bbs-single-line.c.gcov b/compiler-rt/test/profile/Inputs/instrprof-gcov-multiple-bbs-single-line.c.gcov index 92532af30674..4bc1c1cd50f7 100644 --- a/compiler-rt/test/profile/Inputs/instrprof-gcov-multiple-bbs-single-line.c.gcov +++ b/compiler-rt/test/profile/Inputs/instrprof-gcov-multiple-bbs-single-line.c.gcov @@ -4,7 +4,7 @@ // 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: 1: 1:int main(void) // CHECK-NEXT: -: 2:{ // CHECK-NEXT: -: 3: int var; // CHECK-NEXT: -: 4: diff --git a/compiler-rt/test/profile/Inputs/instrprof-gcov-switch1.c.gcov b/compiler-rt/test/profile/Inputs/instrprof-gcov-switch1.c.gcov index f19431e172f9..6e9c5228b938 100644 --- a/compiler-rt/test/profile/Inputs/instrprof-gcov-switch1.c.gcov +++ b/compiler-rt/test/profile/Inputs/instrprof-gcov-switch1.c.gcov @@ -3,7 +3,7 @@ // CHECK-NEXT: -: 0:Data:instrprof-gcov-switch1.gcda // CHECK-NEXT: -: 0:Runs:1 // CHECK-NEXT: -: 0:Programs:1 -// CHECK-NEXT: -: 1:int main(void) +// CHECK-NEXT: 1: 1:int main(void) // CHECK-NEXT: -: 2:{ // CHECK-NEXT: 1: 3: int i = 22; // CHECK-NEXT: -: 4: diff --git a/compiler-rt/test/profile/Inputs/instrprof-gcov-switch2.c.gcov b/compiler-rt/test/profile/Inputs/instrprof-gcov-switch2.c.gcov index 0b85e0f502c5..47d7f1d7cb41 100644 --- a/compiler-rt/test/profile/Inputs/instrprof-gcov-switch2.c.gcov +++ b/compiler-rt/test/profile/Inputs/instrprof-gcov-switch2.c.gcov @@ -3,7 +3,7 @@ // CHECK-NEXT: -: 0:Data:instrprof-gcov-switch2.gcda // CHECK-NEXT: -: 0:Runs:1 // CHECK-NEXT: -: 0:Programs:1 -// CHECK-NEXT: -: 1:int main(void) +// CHECK-NEXT: 1: 1:int main(void) // CHECK-NEXT: -: 2:{ // CHECK-NEXT: 1: 3: int i = 22; // CHECK-NEXT: -: 4: diff --git a/compiler-rt/test/profile/Inputs/instrprof-shared-lib.c.gcov b/compiler-rt/test/profile/Inputs/instrprof-shared-lib.c.gcov index fbc43d5f7d50..620a85257577 100644 --- a/compiler-rt/test/profile/Inputs/instrprof-shared-lib.c.gcov +++ b/compiler-rt/test/profile/Inputs/instrprof-shared-lib.c.gcov @@ -6,7 +6,7 @@ // CHECK-NEXT: -: 1:int g1 = 0; // CHECK-NEXT: -: 2:int g2 = 1; // CHECK-NEXT: -: 3: -// CHECK-NEXT: -: 4:void foo(int n) { +// CHECK-NEXT: 1: 4:void foo(int n) { // CHECK-NEXT: 1: 5: if (n % 5 == 0) // CHECK-NEXT: #####: 6: g1++; // CHECK-NEXT: -: 7: else diff --git a/compiler-rt/test/profile/Inputs/instrprof-shared-lib_called-twice.c.gcov b/compiler-rt/test/profile/Inputs/instrprof-shared-lib_called-twice.c.gcov index 779c885d862d..39b32b8c097a 100644 --- a/compiler-rt/test/profile/Inputs/instrprof-shared-lib_called-twice.c.gcov +++ b/compiler-rt/test/profile/Inputs/instrprof-shared-lib_called-twice.c.gcov @@ -6,7 +6,7 @@ // CHECK-NEXT: -: 1:int g1 = 0; // CHECK-NEXT: -: 2:int g2 = 1; // CHECK-NEXT: -: 3: -// CHECK-NEXT: -: 4:void foo(int n) { +// CHECK-NEXT: 2: 4:void foo(int n) { // CHECK-NEXT: 2: 5: if (n % 5 == 0) // CHECK-NEXT: #####: 6: g1++; // CHECK-NEXT: -: 7: else diff --git a/compiler-rt/test/profile/Inputs/instrprof-shared-lib_in-loop.c.gcov b/compiler-rt/test/profile/Inputs/instrprof-shared-lib_in-loop.c.gcov index 76503d91426e..0fc7ccbabab2 100644 --- a/compiler-rt/test/profile/Inputs/instrprof-shared-lib_in-loop.c.gcov +++ b/compiler-rt/test/profile/Inputs/instrprof-shared-lib_in-loop.c.gcov @@ -6,7 +6,7 @@ // CHECK-NEXT: -: 1:int g1 = 0; // CHECK-NEXT: -: 2:int g2 = 1; // CHECK-NEXT: -: 3: -// CHECK-NEXT: -: 4:void foo(int n) { +// CHECK-NEXT: 1000000: 4:void foo(int n) { // CHECK-NEXT: 1000000: 5: if (n % 5 == 0) // CHECK-NEXT: 360000: 6: g1++; // CHECK-NEXT: -: 7: else diff --git a/compiler-rt/test/profile/Inputs/instrprof-shared-main-gcov-flush_no-writeout.c.gcov b/compiler-rt/test/profile/Inputs/instrprof-shared-main-gcov-flush_no-writeout.c.gcov index b2dfe2acde67..6027c64af61b 100644 --- a/compiler-rt/test/profile/Inputs/instrprof-shared-main-gcov-flush_no-writeout.c.gcov +++ b/compiler-rt/test/profile/Inputs/instrprof-shared-main-gcov-flush_no-writeout.c.gcov @@ -9,14 +9,14 @@ // CHECK-NEXT: -: 4:int bar1 = 0; // CHECK-NEXT: -: 5:int bar2 = 1; // CHECK-NEXT: -: 6: -// CHECK-NEXT: -: 7:void bar(int n) { +// CHECK-NEXT: 1: 7:void bar(int n) { // CHECK-NEXT: 1: 8: if (n % 5 == 0) // CHECK-NEXT: 1: 9: bar1++; // CHECK-NEXT: -: 10: else // CHECK-NEXT: #####: 11: bar2++; // CHECK-NEXT: 1: 12:} // CHECK-NEXT: -: 13: -// CHECK-NEXT: -: 14:int main(int argc, char *argv[]) { +// CHECK-NEXT: 1: 14:int main(int argc, char *argv[]) { // CHECK-NEXT: -: 15:#ifdef SHARED_CALL_BEFORE_GCOV_FLUSH // CHECK-NEXT: 1: 16: foo(1); // CHECK-NEXT: -: 17:#endif diff --git a/compiler-rt/test/profile/Inputs/instrprof-shared-main-gcov-flush_shared-call-after.c.gcov b/compiler-rt/test/profile/Inputs/instrprof-shared-main-gcov-flush_shared-call-after.c.gcov index f70e34e52894..fba3f3fe2812 100644 --- a/compiler-rt/test/profile/Inputs/instrprof-shared-main-gcov-flush_shared-call-after.c.gcov +++ b/compiler-rt/test/profile/Inputs/instrprof-shared-main-gcov-flush_shared-call-after.c.gcov @@ -9,14 +9,14 @@ // CHECK-NEXT: -: 4:int bar1 = 0; // CHECK-NEXT: -: 5:int bar2 = 1; // CHECK-NEXT: -: 6: -// CHECK-NEXT: -: 7:void bar(int n) { +// CHECK-NEXT: 3: 7:void bar(int n) { // CHECK-NEXT: 3: 8: if (n % 5 == 0) // CHECK-NEXT: 3: 9: bar1++; // CHECK-NEXT: -: 10: else // CHECK-NEXT: #####: 11: bar2++; // CHECK-NEXT: 3: 12:} // CHECK-NEXT: -: 13: -// CHECK-NEXT: -: 14:int main(int argc, char *argv[]) { +// CHECK-NEXT: 1: 14:int main(int argc, char *argv[]) { // CHECK-NEXT: -: 15:#ifdef SHARED_CALL_BEFORE_GCOV_FLUSH // CHECK-NEXT: -: 16: foo(1); // CHECK-NEXT: -: 17:#endif diff --git a/compiler-rt/test/profile/Inputs/instrprof-shared-main-gcov-flush_shared-call-before-after.c.gcov b/compiler-rt/test/profile/Inputs/instrprof-shared-main-gcov-flush_shared-call-before-after.c.gcov index b9ecff698722..86beda22a1ad 100644 --- a/compiler-rt/test/profile/Inputs/instrprof-shared-main-gcov-flush_shared-call-before-after.c.gcov +++ b/compiler-rt/test/profile/Inputs/instrprof-shared-main-gcov-flush_shared-call-before-after.c.gcov @@ -9,14 +9,14 @@ // CHECK-NEXT: -: 4:int bar1 = 0; // CHECK-NEXT: -: 5:int bar2 = 1; // CHECK-NEXT: -: 6: -// CHECK-NEXT: -: 7:void bar(int n) { +// CHECK-NEXT: 3: 7:void bar(int n) { // CHECK-NEXT: 3: 8: if (n % 5 == 0) // CHECK-NEXT: 3: 9: bar1++; // CHECK-NEXT: -: 10: else // CHECK-NEXT: #####: 11: bar2++; // CHECK-NEXT: 3: 12:} // CHECK-NEXT: -: 13: -// CHECK-NEXT: -: 14:int main(int argc, char *argv[]) { +// CHECK-NEXT: 1: 14:int main(int argc, char *argv[]) { // CHECK-NEXT: -: 15:#ifdef SHARED_CALL_BEFORE_GCOV_FLUSH // CHECK-NEXT: 1: 16: foo(1); // CHECK-NEXT: -: 17:#endif diff --git a/compiler-rt/test/profile/Inputs/instrprof-shared-main-gcov-flush_shared-call-before.c.gcov b/compiler-rt/test/profile/Inputs/instrprof-shared-main-gcov-flush_shared-call-before.c.gcov index 7c9e0afa11b2..2e55741cc536 100644 --- a/compiler-rt/test/profile/Inputs/instrprof-shared-main-gcov-flush_shared-call-before.c.gcov +++ b/compiler-rt/test/profile/Inputs/instrprof-shared-main-gcov-flush_shared-call-before.c.gcov @@ -9,14 +9,14 @@ // CHECK-NEXT: -: 4:int bar1 = 0; // CHECK-NEXT: -: 5:int bar2 = 1; // CHECK-NEXT: -: 6: -// CHECK-NEXT: -: 7:void bar(int n) { +// CHECK-NEXT: 3: 7:void bar(int n) { // CHECK-NEXT: 3: 8: if (n % 5 == 0) // CHECK-NEXT: 3: 9: bar1++; // CHECK-NEXT: -: 10: else // CHECK-NEXT: #####: 11: bar2++; // CHECK-NEXT: 3: 12:} // CHECK-NEXT: -: 13: -// CHECK-NEXT: -: 14:int main(int argc, char *argv[]) { +// CHECK-NEXT: 1: 14:int main(int argc, char *argv[]) { // CHECK-NEXT: -: 15:#ifdef SHARED_CALL_BEFORE_GCOV_FLUSH // CHECK-NEXT: 1: 16: foo(1); // CHECK-NEXT: -: 17:#endif diff --git a/compiler-rt/test/profile/Inputs/instrprof-shared-main.c.gcov b/compiler-rt/test/profile/Inputs/instrprof-shared-main.c.gcov index 1636ca635988..05cd4e31d6eb 100644 --- a/compiler-rt/test/profile/Inputs/instrprof-shared-main.c.gcov +++ b/compiler-rt/test/profile/Inputs/instrprof-shared-main.c.gcov @@ -6,7 +6,7 @@ // CHECK-NEXT: -: 1:extern int g1, g2; // CHECK-NEXT: -: 2:extern void foo(int n); // CHECK-NEXT: -: 3: -// CHECK-NEXT: -: 4:int main() { +// CHECK-NEXT: 1: 4:int main() { // CHECK-NEXT: -: 5: int i, j; // CHECK-NEXT: 1001: 6: for (i = 0; i < 1000; i++) // CHECK-NEXT: 1001000: 7: for (j = 0; j < 1000; j++)