[compiler-rt] fba8523 - [gcov][test] Reorganize some compiler-rt/test/profile tests
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 3 16:17:25 PDT 2020
Author: Fangrui Song
Date: 2020-07-03T16:17:16-07:00
New Revision: fba8523fb55c8e3bc853df7a250845cf51e5fc99
URL: https://github.com/llvm/llvm-project/commit/fba8523fb55c8e3bc853df7a250845cf51e5fc99
DIFF: https://github.com/llvm/llvm-project/commit/fba8523fb55c8e3bc853df7a250845cf51e5fc99.diff
LOG: [gcov][test] Reorganize some compiler-rt/test/profile tests
Added:
compiler-rt/test/profile/Posix/gcov-execlp.c
compiler-rt/test/profile/Posix/gcov-fork.c
compiler-rt/test/profile/Posix/gcov-shared-flush.c
compiler-rt/test/profile/gcov-dump-and-remove.c
Modified:
compiler-rt/test/profile/gcov-__gcov_flush-terminate.c
Removed:
compiler-rt/test/profile/Inputs/instrprof-gcov-__gcov_flush-multiple.c
compiler-rt/test/profile/Inputs/instrprof-gcov-__gcov_flush-multiple.c.gcov
compiler-rt/test/profile/Inputs/instrprof-gcov-execlp.c
compiler-rt/test/profile/Inputs/instrprof-gcov-execlp.c.gcov
compiler-rt/test/profile/Inputs/instrprof-gcov-execvp.c
compiler-rt/test/profile/Inputs/instrprof-gcov-execvp.c.gcov
compiler-rt/test/profile/Inputs/instrprof-gcov-fork.c
compiler-rt/test/profile/Inputs/instrprof-gcov-fork.c.gcov
compiler-rt/test/profile/Inputs/instrprof-shared-lib.c.gcov
compiler-rt/test/profile/Inputs/instrprof-shared-lib_called-twice.c.gcov
compiler-rt/test/profile/Inputs/instrprof-shared-main-gcov-flush.c
compiler-rt/test/profile/Inputs/instrprof-shared-main-gcov-flush_no-writeout.c.gcov
compiler-rt/test/profile/Inputs/instrprof-shared-main-gcov-flush_shared-call-after.c.gcov
compiler-rt/test/profile/Inputs/instrprof-shared-main-gcov-flush_shared-call-before-after.c.gcov
compiler-rt/test/profile/Inputs/instrprof-shared-main-gcov-flush_shared-call-before.c.gcov
compiler-rt/test/profile/Posix/instrprof-gcov-execlp.test
compiler-rt/test/profile/Posix/instrprof-gcov-execvp.test
compiler-rt/test/profile/Posix/instrprof-gcov-fork.test
compiler-rt/test/profile/Posix/instrprof-shared-gcov-flush.test
compiler-rt/test/profile/instrprof-gcov-__gcov_flush-multiple.test
################################################################################
diff --git a/compiler-rt/test/profile/Inputs/instrprof-gcov-__gcov_flush-multiple.c b/compiler-rt/test/profile/Inputs/instrprof-gcov-__gcov_flush-multiple.c
deleted file mode 100644
index 56e0538b1e83..000000000000
--- a/compiler-rt/test/profile/Inputs/instrprof-gcov-__gcov_flush-multiple.c
+++ /dev/null
@@ -1,18 +0,0 @@
-extern void __gcov_flush();
-extern int remove(const char *);
-int main(void) {
- __gcov_flush();
-
- if (remove("instrprof-gcov-__gcov_flush-multiple.gcda") != 0) {
- return 1;
- }
-
- __gcov_flush();
- __gcov_flush();
-
- if (remove("instrprof-gcov-__gcov_flush-multiple.gcda") != 0) {
- return 1;
- }
-
- return 0;
-}
diff --git a/compiler-rt/test/profile/Inputs/instrprof-gcov-__gcov_flush-multiple.c.gcov b/compiler-rt/test/profile/Inputs/instrprof-gcov-__gcov_flush-multiple.c.gcov
deleted file mode 100644
index b0921d22461e..000000000000
--- a/compiler-rt/test/profile/Inputs/instrprof-gcov-__gcov_flush-multiple.c.gcov
+++ /dev/null
@@ -1,23 +0,0 @@
-// CHECK: -: 0:Source:{{.*}}Inputs{{[/\\]}}instrprof-gcov-__gcov_flush-multiple.c
-// CHECK-NEXT: -: 0:Graph:instrprof-gcov-__gcov_flush-multiple.gcno
-// CHECK-NEXT: -: 0:Data:instrprof-gcov-__gcov_flush-multiple.gcda
-// CHECK-NEXT: -: 0:Runs:1
-// CHECK-NEXT: -: 0:Programs:1
-// CHECK-NEXT: -: 1:extern void __gcov_flush();
-// CHECK-NEXT: -: 2:extern int remove(const char *);
-// CHECK-NEXT: #####: 3:int main(void) {
-// CHECK-NEXT: #####: 4: __gcov_flush();
-// CHECK-NEXT: -: 5:
-// CHECK-NEXT: #####: 6: if (remove("instrprof-gcov-__gcov_flush-multiple.gcda") != 0) {
-// CHECK-NEXT: #####: 7: return 1;
-// CHECK-NEXT: -: 8: }
-// CHECK-NEXT: -: 9:
-// CHECK-NEXT: #####: 10: __gcov_flush();
-// CHECK-NEXT: #####: 11: __gcov_flush();
-// CHECK-NEXT: -: 12:
-// CHECK-NEXT: #####: 13: if (remove("instrprof-gcov-__gcov_flush-multiple.gcda") != 0) {
-// CHECK-NEXT: #####: 14: return 1;
-// CHECK-NEXT: -: 15: }
-// CHECK-NEXT: -: 16:
-// CHECK-NEXT: 1: 17: return 0;
-// CHECK-NEXT: 1: 18:}
diff --git a/compiler-rt/test/profile/Inputs/instrprof-gcov-execlp.c b/compiler-rt/test/profile/Inputs/instrprof-gcov-execlp.c
deleted file mode 100644
index 5213a5b80360..000000000000
--- a/compiler-rt/test/profile/Inputs/instrprof-gcov-execlp.c
+++ /dev/null
@@ -1,15 +0,0 @@
-#include <unistd.h>
-
-void func1() {}
-void func2() {}
-
-int main(void)
-{
- func1();
-
- execlp("ls", "-l", "-h", (char*)0);
-
- func2();
-
- return 0;
-}
diff --git a/compiler-rt/test/profile/Inputs/instrprof-gcov-execlp.c.gcov b/compiler-rt/test/profile/Inputs/instrprof-gcov-execlp.c.gcov
deleted file mode 100644
index 810046aac396..000000000000
--- a/compiler-rt/test/profile/Inputs/instrprof-gcov-execlp.c.gcov
+++ /dev/null
@@ -1,23 +0,0 @@
-//CHECK: -: 0:Source:{{.*}}Inputs{{[/\\]}}instrprof-gcov-execlp.c
-//CHECK-NEXT: -: 0:Graph:instrprof-gcov-execlp.gcno
-//CHECK-NEXT: -: 0:Data:instrprof-gcov-execlp.gcda
-//CHECK-NEXT: -: 0:Runs:1
-//CHECK-NEXT: -: 0:Programs:1
-//CHECK-NEXT: -: 1:#include <unistd.h>
-//CHECK-NEXT: -: 2:
-//CHECK-NEXT:function func1 called 1 returned 100% blocks executed 100%
-//CHECK-NEXT: 1: 3:void func1() {}
-//CHECK-NEXT:function func2 called 0 returned 0% blocks executed 0%
-//CHECK-NEXT: #####: 4:void func2() {}
-//CHECK-NEXT: -: 5:
-//CHECK-NEXT:function main called 1 returned 0% blocks executed 33%
-//CHECK-NEXT: 1: 6:int main(void)
-//CHECK-NEXT: -: 7:{
-//CHECK-NEXT: 1: 8: func1();
-//CHECK-NEXT: -: 9:
-//CHECK-NEXT: 1: 10: execlp("ls", "-l", "-h", (char*)0);
-//CHECK-NEXT: -: 11:
-//CHECK-NEXT: #####: 12: func2();
-//CHECK-NEXT: -: 13:
-//CHECK-NEXT: #####: 14: return 0;
-//CHECK-NEXT: -: 15:}
diff --git a/compiler-rt/test/profile/Inputs/instrprof-gcov-execvp.c b/compiler-rt/test/profile/Inputs/instrprof-gcov-execvp.c
deleted file mode 100644
index f2e411c2a42e..000000000000
--- a/compiler-rt/test/profile/Inputs/instrprof-gcov-execvp.c
+++ /dev/null
@@ -1,17 +0,0 @@
-#include <unistd.h>
-
-void func1() {}
-void func2() {}
-
-int main(void)
-{
- char *const args[] = {"-l", "-h", (char*)0};
-
- func1();
-
- execvp("ls", args);
-
- func2();
-
- return 0;
-}
diff --git a/compiler-rt/test/profile/Inputs/instrprof-gcov-execvp.c.gcov b/compiler-rt/test/profile/Inputs/instrprof-gcov-execvp.c.gcov
deleted file mode 100644
index e896cb8917e7..000000000000
--- a/compiler-rt/test/profile/Inputs/instrprof-gcov-execvp.c.gcov
+++ /dev/null
@@ -1,25 +0,0 @@
-//CHECK: -: 0:Source:{{.*}}Inputs{{[/\\]}}instrprof-gcov-execvp.c
-//CHECK-NEXT: -: 0:Graph:instrprof-gcov-execvp.gcno
-//CHECK-NEXT: -: 0:Data:instrprof-gcov-execvp.gcda
-//CHECK-NEXT: -: 0:Runs:1
-//CHECK-NEXT: -: 0:Programs:1
-//CHECK-NEXT: -: 1:#include <unistd.h>
-//CHECK-NEXT: -: 2:
-//CHECK-NEXT:function func1 called 1 returned 100% blocks executed 100%
-//CHECK-NEXT: 1: 3:void func1() {}
-//CHECK-NEXT:function func2 called 0 returned 0% blocks executed 0%
-//CHECK-NEXT: #####: 4:void func2() {}
-//CHECK-NEXT: -: 5:
-//CHECK-NEXT:function main called 1 returned 0% blocks executed 33%
-//CHECK-NEXT: 1: 6:int main(void)
-//CHECK-NEXT: -: 7:{
-//CHECK-NEXT: 1: 8: char *const args[] = {"-l", "-h", (char*)0};
-//CHECK-NEXT: -: 9:
-//CHECK-NEXT: 1: 10: func1();
-//CHECK-NEXT: -: 11:
-//CHECK-NEXT: 1: 12: execvp("ls", args);
-//CHECK-NEXT: -: 13:
-//CHECK-NEXT: #####: 14: func2();
-//CHECK-NEXT: -: 15:
-//CHECK-NEXT: #####: 16: return 0;
-//CHECK-NEXT: -: 17:}
diff --git a/compiler-rt/test/profile/Inputs/instrprof-gcov-fork.c b/compiler-rt/test/profile/Inputs/instrprof-gcov-fork.c
deleted file mode 100644
index 818c459c50dd..000000000000
--- a/compiler-rt/test/profile/Inputs/instrprof-gcov-fork.c
+++ /dev/null
@@ -1,15 +0,0 @@
-#include <unistd.h>
-
-void func1() {}
-void func2() {}
-
-int main(void)
-{
- func1();
-
- fork();
-
- func2();
-
- return 0;
-}
diff --git a/compiler-rt/test/profile/Inputs/instrprof-gcov-fork.c.gcov b/compiler-rt/test/profile/Inputs/instrprof-gcov-fork.c.gcov
deleted file mode 100644
index 2825bd5802a7..000000000000
--- a/compiler-rt/test/profile/Inputs/instrprof-gcov-fork.c.gcov
+++ /dev/null
@@ -1,23 +0,0 @@
-// CHECK: -: 0:Source:{{.*}}Inputs{{[/\\]}}instrprof-gcov-fork.c
-// CHECK-NEXT: -: 0:Graph:instrprof-gcov-fork.gcno
-// CHECK-NEXT: -: 0:Data:instrprof-gcov-fork.gcda
-// CHECK-NEXT: -: 0:Runs:1
-// CHECK-NEXT: -: 0:Programs:1
-// CHECK-NEXT: -: 1:#include <unistd.h>
-// CHECK-NEXT: -: 2:
-// CHECK-NEXT:function func1 called 1 returned 100% blocks executed 100%
-// CHECK-NEXT: 1: 3:void func1() {}
-// CHECK-NEXT:function func2 called 2 returned 100% blocks executed 100%
-// CHECK-NEXT: 2: 4:void func2() {}
-// CHECK-NEXT: -: 5:
-// CHECK-NEXT:function main called 1 returned 200% blocks executed 100%
-// CHECK-NEXT: 1: 6:int main(void)
-// CHECK-NEXT: -: 7:{
-// CHECK-NEXT: 1: 8: func1();
-// CHECK-NEXT: -: 9:
-// CHECK-NEXT: 1: 10: fork();
-// CHECK-NEXT: -: 11:
-// CHECK-NEXT: 2: 12: func2();
-// CHECK-NEXT: -: 13:
-// CHECK-NEXT: 2: 14: return 0;
-// CHECK-NEXT: -: 15:}
diff --git a/compiler-rt/test/profile/Inputs/instrprof-shared-lib.c.gcov b/compiler-rt/test/profile/Inputs/instrprof-shared-lib.c.gcov
deleted file mode 100644
index 7e6d741d5b10..000000000000
--- a/compiler-rt/test/profile/Inputs/instrprof-shared-lib.c.gcov
+++ /dev/null
@@ -1,14 +0,0 @@
-// CHECK: -: 0:Source:{{.*}}Inputs{{[/\\]}}instrprof-shared-lib.c
-// CHECK-NEXT: -: 0:Graph:instrprof-shared-lib.gcno
-// CHECK-NEXT: -: 0:Data:instrprof-shared-lib.gcda
-// CHECK-NEXT: -: 0:Runs:1
-// CHECK-NEXT: -: 0:Programs:1
-// CHECK-NEXT: -: 1:int g1 = 0;
-// CHECK-NEXT: -: 2:int g2 = 1;
-// CHECK-NEXT: -: 3:
-// CHECK-NEXT: 1: 4:void foo(int n) {
-// CHECK-NEXT: 1: 5: if (n % 5 == 0)
-// CHECK-NEXT: #####: 6: g1++;
-// CHECK-NEXT: -: 7: else
-// CHECK-NEXT: 1: 8: g2++;
-// CHECK-NEXT: 1: 9:}
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
deleted file mode 100644
index 993c6cc508b2..000000000000
--- a/compiler-rt/test/profile/Inputs/instrprof-shared-lib_called-twice.c.gcov
+++ /dev/null
@@ -1,14 +0,0 @@
-// CHECK: -: 0:Source:{{.*}}Inputs{{[/\\]}}instrprof-shared-lib.c
-// CHECK-NEXT: -: 0:Graph:instrprof-shared-lib.gcno
-// CHECK-NEXT: -: 0:Data:instrprof-shared-lib.gcda
-// CHECK-NEXT: -: 0:Runs:1
-// CHECK-NEXT: -: 0:Programs:1
-// CHECK-NEXT: -: 1:int g1 = 0;
-// CHECK-NEXT: -: 2:int g2 = 1;
-// CHECK-NEXT: -: 3:
-// CHECK-NEXT: 2: 4:void foo(int n) {
-// CHECK-NEXT: 2: 5: if (n % 5 == 0)
-// CHECK-NEXT: #####: 6: g1++;
-// CHECK-NEXT: -: 7: else
-// CHECK-NEXT: 2: 8: g2++;
-// CHECK-NEXT: 2: 9:}
diff --git a/compiler-rt/test/profile/Inputs/instrprof-shared-main-gcov-flush.c b/compiler-rt/test/profile/Inputs/instrprof-shared-main-gcov-flush.c
deleted file mode 100644
index 9f41b7e6362a..000000000000
--- a/compiler-rt/test/profile/Inputs/instrprof-shared-main-gcov-flush.c
+++ /dev/null
@@ -1,36 +0,0 @@
-extern void foo(int n);
-extern void __gcov_flush(void);
-
-int bar1 = 0;
-int bar2 = 1;
-
-void bar(int n) {
- if (n % 5 == 0)
- bar1++;
- else
- bar2++;
-}
-
-int main(int argc, char *argv[]) {
-#ifdef SHARED_CALL_BEFORE_GCOV_FLUSH
- foo(1);
-#endif
-
- bar(5);
-
- __gcov_flush();
-
- bar(5);
-
-#ifdef SHARED_CALL_AFTER_GCOV_FLUSH
- foo(1);
-#endif
-
-#ifdef EXIT_ABRUPTLY
- _exit(0);
-#endif
-
- bar(5);
-
- return 0;
-}
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
deleted file mode 100644
index 82a489158a33..000000000000
--- a/compiler-rt/test/profile/Inputs/instrprof-shared-main-gcov-flush_no-writeout.c.gcov
+++ /dev/null
@@ -1,41 +0,0 @@
-// CHECK: -: 0:Source:{{.*}}Inputs{{[/\\]}}instrprof-shared-main-gcov-flush.c
-// CHECK-NEXT: -: 0:Graph:instrprof-shared-main-gcov-flush.gcno
-// CHECK-NEXT: -: 0:Data:instrprof-shared-main-gcov-flush.gcda
-// CHECK-NEXT: -: 0:Runs:1
-// CHECK-NEXT: -: 0:Programs:1
-// CHECK-NEXT: -: 1:extern void foo(int n);
-// CHECK-NEXT: -: 2:extern void __gcov_flush(void);
-// CHECK-NEXT: -: 3:
-// CHECK-NEXT: -: 4:int bar1 = 0;
-// CHECK-NEXT: -: 5:int bar2 = 1;
-// CHECK-NEXT: -: 6:
-// 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: 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
-// CHECK-NEXT: -: 18:
-// CHECK-NEXT: 1: 19: bar(5);
-// CHECK-NEXT: -: 20:
-// CHECK-NEXT: 1: 21: __gcov_flush();
-// CHECK-NEXT: -: 22:
-// CHECK-NEXT: 1: 23: bar(5);
-// CHECK-NEXT: -: 24:
-// CHECK-NEXT: -: 25:#ifdef SHARED_CALL_AFTER_GCOV_FLUSH
-// CHECK-NEXT: 1: 26: foo(1);
-// CHECK-NEXT: -: 27:#endif
-// CHECK-NEXT: -: 28:
-// CHECK-NEXT: -: 29:#ifdef EXIT_ABRUPTLY
-// CHECK-NEXT: 1: 30: _exit(0);
-// CHECK-NEXT: -: 31:#endif
-// CHECK-NEXT: -: 32:
-// CHECK-NEXT: -: 33: bar(5);
-// CHECK-NEXT: -: 34:
-// CHECK-NEXT: -: 35: return 0;
-// CHECK-NEXT: -: 36:}
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
deleted file mode 100644
index 5cc26580b222..000000000000
--- a/compiler-rt/test/profile/Inputs/instrprof-shared-main-gcov-flush_shared-call-after.c.gcov
+++ /dev/null
@@ -1,41 +0,0 @@
-// CHECK: -: 0:Source:{{.*}}Inputs{{[/\\]}}instrprof-shared-main-gcov-flush.c
-// CHECK-NEXT: -: 0:Graph:instrprof-shared-main-gcov-flush.gcno
-// CHECK-NEXT: -: 0:Data:instrprof-shared-main-gcov-flush.gcda
-// CHECK-NEXT: -: 0:Runs:1
-// CHECK-NEXT: -: 0:Programs:1
-// CHECK-NEXT: -: 1:extern void foo(int n);
-// CHECK-NEXT: -: 2:extern void __gcov_flush(void);
-// CHECK-NEXT: -: 3:
-// CHECK-NEXT: -: 4:int bar1 = 0;
-// CHECK-NEXT: -: 5:int bar2 = 1;
-// CHECK-NEXT: -: 6:
-// 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: 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
-// CHECK-NEXT: -: 18:
-// CHECK-NEXT: 1: 19: bar(5);
-// CHECK-NEXT: -: 20:
-// CHECK-NEXT: 1: 21: __gcov_flush();
-// CHECK-NEXT: -: 22:
-// CHECK-NEXT: 1: 23: bar(5);
-// CHECK-NEXT: -: 24:
-// CHECK-NEXT: -: 25:#ifdef SHARED_CALL_AFTER_GCOV_FLUSH
-// CHECK-NEXT: 1: 26: foo(1);
-// CHECK-NEXT: -: 27:#endif
-// CHECK-NEXT: -: 28:
-// CHECK-NEXT: -: 29:#ifdef EXIT_ABRUPTLY
-// CHECK-NEXT: -: 30: _exit(0);
-// CHECK-NEXT: -: 31:#endif
-// CHECK-NEXT: -: 32:
-// CHECK-NEXT: 1: 33: bar(5);
-// CHECK-NEXT: -: 34:
-// CHECK-NEXT: 1: 35: return 0;
-// CHECK-NEXT: -: 36:}
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
deleted file mode 100644
index 7a6800c47f84..000000000000
--- a/compiler-rt/test/profile/Inputs/instrprof-shared-main-gcov-flush_shared-call-before-after.c.gcov
+++ /dev/null
@@ -1,41 +0,0 @@
-// CHECK: -: 0:Source:{{.*}}Inputs{{[/\\]}}instrprof-shared-main-gcov-flush.c
-// CHECK-NEXT: -: 0:Graph:instrprof-shared-main-gcov-flush.gcno
-// CHECK-NEXT: -: 0:Data:instrprof-shared-main-gcov-flush.gcda
-// CHECK-NEXT: -: 0:Runs:1
-// CHECK-NEXT: -: 0:Programs:1
-// CHECK-NEXT: -: 1:extern void foo(int n);
-// CHECK-NEXT: -: 2:extern void __gcov_flush(void);
-// CHECK-NEXT: -: 3:
-// CHECK-NEXT: -: 4:int bar1 = 0;
-// CHECK-NEXT: -: 5:int bar2 = 1;
-// CHECK-NEXT: -: 6:
-// 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: 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
-// CHECK-NEXT: -: 18:
-// CHECK-NEXT: 1: 19: bar(5);
-// CHECK-NEXT: -: 20:
-// CHECK-NEXT: 1: 21: __gcov_flush();
-// CHECK-NEXT: -: 22:
-// CHECK-NEXT: 1: 23: bar(5);
-// CHECK-NEXT: -: 24:
-// CHECK-NEXT: -: 25:#ifdef SHARED_CALL_AFTER_GCOV_FLUSH
-// CHECK-NEXT: 1: 26: foo(1);
-// CHECK-NEXT: -: 27:#endif
-// CHECK-NEXT: -: 28:
-// CHECK-NEXT: -: 29:#ifdef EXIT_ABRUPTLY
-// CHECK-NEXT: -: 30: _exit(0);
-// CHECK-NEXT: -: 31:#endif
-// CHECK-NEXT: -: 32:
-// CHECK-NEXT: 1: 33: bar(5);
-// CHECK-NEXT: -: 34:
-// CHECK-NEXT: 1: 35: return 0;
-// CHECK-NEXT: -: 36:}
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
deleted file mode 100644
index 49995fdc8635..000000000000
--- a/compiler-rt/test/profile/Inputs/instrprof-shared-main-gcov-flush_shared-call-before.c.gcov
+++ /dev/null
@@ -1,41 +0,0 @@
-// CHECK: -: 0:Source:{{.*}}Inputs{{[/\\]}}instrprof-shared-main-gcov-flush.c
-// CHECK-NEXT: -: 0:Graph:instrprof-shared-main-gcov-flush.gcno
-// CHECK-NEXT: -: 0:Data:instrprof-shared-main-gcov-flush.gcda
-// CHECK-NEXT: -: 0:Runs:1
-// CHECK-NEXT: -: 0:Programs:1
-// CHECK-NEXT: -: 1:extern void foo(int n);
-// CHECK-NEXT: -: 2:extern void __gcov_flush(void);
-// CHECK-NEXT: -: 3:
-// CHECK-NEXT: -: 4:int bar1 = 0;
-// CHECK-NEXT: -: 5:int bar2 = 1;
-// CHECK-NEXT: -: 6:
-// 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: 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
-// CHECK-NEXT: -: 18:
-// CHECK-NEXT: 1: 19: bar(5);
-// CHECK-NEXT: -: 20:
-// CHECK-NEXT: 1: 21: __gcov_flush();
-// CHECK-NEXT: -: 22:
-// CHECK-NEXT: 1: 23: bar(5);
-// CHECK-NEXT: -: 24:
-// CHECK-NEXT: -: 25:#ifdef SHARED_CALL_AFTER_GCOV_FLUSH
-// CHECK-NEXT: -: 26: foo(1);
-// CHECK-NEXT: -: 27:#endif
-// CHECK-NEXT: -: 28:
-// CHECK-NEXT: -: 29:#ifdef EXIT_ABRUPTLY
-// CHECK-NEXT: -: 30: _exit(0);
-// CHECK-NEXT: -: 31:#endif
-// CHECK-NEXT: -: 32:
-// CHECK-NEXT: 1: 33: bar(5);
-// CHECK-NEXT: -: 34:
-// CHECK-NEXT: 1: 35: return 0;
-// CHECK-NEXT: -: 36:}
diff --git a/compiler-rt/test/profile/Posix/gcov-execlp.c b/compiler-rt/test/profile/Posix/gcov-execlp.c
new file mode 100644
index 000000000000..0b70e9c69790
--- /dev/null
+++ b/compiler-rt/test/profile/Posix/gcov-execlp.c
@@ -0,0 +1,28 @@
+/// A basic block with fork/exec* is split. .gcda is flushed immediately before
+/// fork/exec* so the lines before exec* are counted once while succeeding
+/// lines are not counted.
+// RUN: mkdir -p %t.d && cd %t.d
+// RUN: %clang --coverage %s -o %t
+// RUN: test -f gcov-execlp.gcno
+// RUN: rm -f gcov-execlp.gcda && %run %t
+// RUN: llvm-cov gcov -t gcov-execlp.gcda | FileCheck %s --check-prefixes=CHECK,EXECLP
+
+// RUN: %clang --coverage -DEXECVP %s -o %t
+// RUN: rm -f gcov-execlp.gcda && %run %t
+// RUN: llvm-cov gcov -t gcov-execlp.gcda | FileCheck %s --check-prefixes=CHECK,EXECVP
+
+#include <unistd.h>
+
+void func1(void) {} // CHECK: 1: [[#@LINE]]:void func1(void)
+void func2(void) {} // CHECK-NEXT: #####: [[#@LINE]]:
+int main(void) { // CHECK-NEXT: 1: [[#@LINE]]:
+ func1(); // CHECK-NEXT: 1: [[#@LINE]]:
+#ifdef EXECVP
+ char *argv[] = {"ls", "-l", "-h", (char *)0};
+ execvp("ls", argv); // EXECVP: 1: [[#@LINE]]: execvp
+#else
+ execlp("ls", "-l", "-h", (char *)0); // EXECLP: 1: [[#@LINE]]: execlp
+#endif
+ func2(); // CHECK: #####: [[#@LINE]]: func2
+ return 0; // CHECK-NEXT: #####: [[#@LINE]]:
+}
diff --git a/compiler-rt/test/profile/Posix/gcov-fork.c b/compiler-rt/test/profile/Posix/gcov-fork.c
new file mode 100644
index 000000000000..67fe68cc3c71
--- /dev/null
+++ b/compiler-rt/test/profile/Posix/gcov-fork.c
@@ -0,0 +1,22 @@
+/// A basic block with fork/exec* is split. .gcda is flushed immediately before
+/// fork/exec* so the lines before fork are counted once while succeeding
+/// lines are counted twice.
+// UNSUPPORTED: darwin
+
+// RUN: mkdir -p %t.d && cd %t.d
+// RUN: %clang --coverage %s -o %t
+// RUN: test -f gcov-fork.gcno
+
+// RUN: rm -f gcov-fork.gcda && %run %t
+// RUN: llvm-cov gcov -t gcov-fork.gcda | FileCheck %s
+
+#include <unistd.h>
+
+void func1() {} // CHECK: 1: [[#@LINE]]:void func1()
+void func2() {} // CHECK-NEXT: 2: [[#@LINE]]:
+int main(void) { // CHECK-NEXT: 1: [[#@LINE]]:
+ func1(); // CHECK-NEXT: 1: [[#@LINE]]:
+ fork(); // CHECK-NEXT: 1: [[#@LINE]]:
+ func2(); // CHECK-NEXT: 2: [[#@LINE]]:
+ return 0; // CHECK-NEXT: 2: [[#@LINE]]:
+}
diff --git a/compiler-rt/test/profile/Posix/gcov-shared-flush.c b/compiler-rt/test/profile/Posix/gcov-shared-flush.c
new file mode 100644
index 000000000000..97d44ad5204e
--- /dev/null
+++ b/compiler-rt/test/profile/Posix/gcov-shared-flush.c
@@ -0,0 +1,113 @@
+/// This test fails on Mac (https://bugs.llvm.org/show_bug.cgi?id=38134)
+// XFAIL: darwin
+
+// RUN: mkdir -p %t.d && cd %t.d
+
+// RUN: %clang -E -DSHARED %s -o shared.c
+// RUN: %clang --coverage -fPIC -shared shared.c -o libfunc.so
+// RUN: test -f shared.gcno
+
+/// Test the case where we exit abruptly after calling __gcov_flush, which means we don't write out the counters at exit.
+// RUN: %clang -DEXIT_ABRUPTLY -DSHARED_CALL_BEFORE_FLUSH -DSHARED_CALL_AFTER_FLUSH --coverage %s -L%t.d -rpath %t.d -lfunc -o %t
+// RUN: test -f gcov-shared-flush.gcno
+
+// RUN: rm -f gcov-shared-flush.gcda shared.gcda
+// RUN: %run %t
+// RUN: llvm-cov gcov -t gcov-shared-flush.gcda | FileCheck %s --check-prefix=NO_WRITEOUT
+// RUN: llvm-cov gcov -t shared.gcda | FileCheck %s --check-prefix=SHARED
+
+// NO_WRITEOUT: -: [[#%u,L:]]:#ifdef EXIT_ABRUPTLY
+// NO_WRITEOUT-NEXT: 1: [[#%u,L+1]]: _exit(0);
+
+// SHARED: 1: {{[[0-9]+}}:void foo(int n)
+
+/// Test the case where we exit normally and we have a call to the shared library function before __gcov_flush.
+// RUN: %clang -DSHARED_CALL_BEFORE_FLUSH --coverage %s -L%t.d -rpath %t.d -lfunc -o %t
+// RUN: test -f gcov-shared-flush.gcno
+
+// RUN: rm -f gcov-shared-flush.gcda shared.gcda
+// RUN: %run %t
+// RUN: llvm-cov gcov -t gcov-shared-flush.gcda | FileCheck %s --check-prefix=BEFORE
+// RUN: llvm-cov gcov -t shared.gcda | FileCheck %s --check-prefix=SHARED_ONCE
+
+// BEFORE: -: {{[0-9]+}}:#ifdef SHARED_CALL_BEFORE_FLUSH
+// BEFORE-NEXT: 1: {{[0-9]+}}: foo(1);
+// BEFORE: 1: {{[0-9]+}}: __gcov_flush();
+// BEFORE: -: {{[0-9]+}}:#ifdef SHARED_CALL_AFTER_FLUSH
+// BEFORE-NEXT: -: {{[0-9]+}}: foo(1);
+// BEFORE: 1: {{[0-9]+}}: bar(5);
+
+// SHARED_ONCE: 1: {{[0-9]+}}:void foo(int n)
+
+// # Test the case where we exit normally and we have a call to the shared library function after __gcov_flush.
+// RUN: %clang -DSHARED_CALL_AFTER_FLUSH --coverage %s -L%t.d -rpath %t.d -lfunc -o %t
+// RUN: test -f gcov-shared-flush.gcno
+
+// RUN: rm -f gcov-shared-flush.gcda shared.gcda
+// RUN: %run %t
+// RUN: llvm-cov gcov -t gcov-shared-flush.gcda | FileCheck %s --check-prefix=AFTER
+// RUN: llvm-cov gcov -t shared.gcda > 2s.txt
+
+// AFTER: -: {{[0-9]+}}:#ifdef SHARED_CALL_BEFORE_FLUSH
+// AFTER-NEXT: -: {{[0-9]+}}: foo(1);
+// AFTER: 1: {{[0-9]+}}: __gcov_flush();
+// AFTER: -: {{[0-9]+}}:#ifdef SHARED_CALL_AFTER_FLUSH
+// AFTER-NEXT: 1: {{[0-9]+}}: foo(1);
+// AFTER: 1: {{[0-9]+}}: bar(5);
+
+// # Test the case where we exit normally and we have calls to the shared library function before and after __gcov_flush.
+// RUN: %clang -DSHARED_CALL_BEFORE_FLUSH -DSHARED_CALL_AFTER_FLUSH --coverage %s -L%t.d -rpath %t.d -lfunc -o %t
+// RUN: test -f gcov-shared-flush.gcno
+
+// RUN: rm -f gcov-shared-flush.gcda shared.gcda
+// RUN: %run %t
+// RUN: llvm-cov gcov -t gcov-shared-flush.gcda | FileCheck %s --check-prefix=BEFORE_AFTER
+// RUN: llvm-cov gcov -t shared.gcda | FileCheck %s --check-prefix=SHARED_TWICE
+
+// BEFORE_AFTER: -: {{[0-9]+}}:#ifdef SHARED_CALL_BEFORE_FLUSH
+// BEFORE_AFTER-NEXT: 1: {{[0-9]+}}: foo(1);
+// BEFORE_AFTER: 1: {{[0-9]+}}: __gcov_flush();
+// BEFORE_AFTER: -: {{[0-9]+}}:#ifdef SHARED_CALL_AFTER_FLUSH
+// BEFORE_AFTER-NEXT: 1: {{[0-9]+}}: foo(1);
+// BEFORE_AFTER: 1: {{[0-9]+}}: bar(5);
+
+// SHARED_TWICE: 2: {{[0-9]+}}:void foo(int n)
+
+#ifdef SHARED
+void foo(int n) {
+}
+#else
+extern void foo(int n);
+extern void __gcov_flush(void);
+
+int bar1 = 0;
+int bar2 = 1;
+
+void bar(int n) {
+ if (n % 5 == 0)
+ bar1++;
+ else
+ bar2++;
+}
+
+int main(int argc, char *argv[]) {
+#ifdef SHARED_CALL_BEFORE_FLUSH
+ foo(1);
+#endif
+
+ bar(5);
+ __gcov_flush();
+ bar(5);
+
+#ifdef SHARED_CALL_AFTER_FLUSH
+ foo(1);
+#endif
+
+#ifdef EXIT_ABRUPTLY
+ _exit(0);
+#endif
+
+ bar(5);
+ return 0;
+}
+#endif
diff --git a/compiler-rt/test/profile/Posix/instrprof-gcov-execlp.test b/compiler-rt/test/profile/Posix/instrprof-gcov-execlp.test
deleted file mode 100644
index 1d136ce97907..000000000000
--- a/compiler-rt/test/profile/Posix/instrprof-gcov-execlp.test
+++ /dev/null
@@ -1,10 +0,0 @@
-RUN: mkdir -p %t.d
-RUN: cd %t.d
-
-RUN: %clang --coverage -o %t %S/../Inputs/instrprof-gcov-execlp.c
-RUN: test -f instrprof-gcov-execlp.gcno
-
-RUN: rm -f instrprof-gcov-execlp.gcda
-RUN: %run %t
-RUN: llvm-cov gcov -b -c instrprof-gcov-execlp.gcda
-RUN: FileCheck --match-full-lines --strict-whitespace --input-file instrprof-gcov-execlp.c.gcov %S/../Inputs/instrprof-gcov-execlp.c.gcov
diff --git a/compiler-rt/test/profile/Posix/instrprof-gcov-execvp.test b/compiler-rt/test/profile/Posix/instrprof-gcov-execvp.test
deleted file mode 100644
index 8e5cbc609509..000000000000
--- a/compiler-rt/test/profile/Posix/instrprof-gcov-execvp.test
+++ /dev/null
@@ -1,10 +0,0 @@
-RUN: mkdir -p %t.d
-RUN: cd %t.d
-
-RUN: %clang --coverage -o %t %S/../Inputs/instrprof-gcov-execvp.c
-RUN: test -f instrprof-gcov-execvp.gcno
-
-RUN: rm -f instrprof-gcov-execvp.gcda
-RUN: %run %t
-RUN: llvm-cov gcov -b -c instrprof-gcov-execvp.gcda
-RUN: FileCheck --match-full-lines --strict-whitespace --input-file instrprof-gcov-execvp.c.gcov %S/../Inputs/instrprof-gcov-execvp.c.gcov
diff --git a/compiler-rt/test/profile/Posix/instrprof-gcov-fork.test b/compiler-rt/test/profile/Posix/instrprof-gcov-fork.test
deleted file mode 100644
index 31b6a23be49c..000000000000
--- a/compiler-rt/test/profile/Posix/instrprof-gcov-fork.test
+++ /dev/null
@@ -1,13 +0,0 @@
-UNSUPPORTED: linux
-UNSUPPORTED: darwin
-
-RUN: mkdir -p %t.d
-RUN: cd %t.d
-
-RUN: %clang --coverage -o %t %S/../Inputs/instrprof-gcov-fork.c
-RUN: test -f instrprof-gcov-fork.gcno
-
-RUN: rm -f instrprof-gcov-fork.gcda
-RUN: %run %t
-RUN: llvm-cov gcov -b -c instrprof-gcov-fork.gcda
-RUN: FileCheck --match-full-lines --strict-whitespace --input-file instrprof-gcov-fork.c.gcov %S/../Inputs/instrprof-gcov-fork.c.gcov
diff --git a/compiler-rt/test/profile/Posix/instrprof-shared-gcov-flush.test b/compiler-rt/test/profile/Posix/instrprof-shared-gcov-flush.test
deleted file mode 100644
index 8d530fd452a7..000000000000
--- a/compiler-rt/test/profile/Posix/instrprof-shared-gcov-flush.test
+++ /dev/null
@@ -1,52 +0,0 @@
-# This test fails on Mac (https://bugs.llvm.org/show_bug.cgi?id=38134)
-XFAIL: darwin
-
-RUN: mkdir -p %t.d
-RUN: cd %t.d
-
-RUN: %clang --coverage -o libfunc.so -fPIC -shared %S/../Inputs/instrprof-shared-lib.c
-RUN: test -f instrprof-shared-lib.gcno
-
-# Test the case where we exit abruptly after calling __gcov_flush, which means we don't write out the counters at exit.
-RUN: %clang -DEXIT_ABRUPTLY -DSHARED_CALL_BEFORE_GCOV_FLUSH -DSHARED_CALL_AFTER_GCOV_FLUSH --coverage -o %t -L%t.d -rpath %t.d -lfunc %S/../Inputs/instrprof-shared-main-gcov-flush.c
-RUN: test -f instrprof-shared-main-gcov-flush.gcno
-
-RUN: rm -f instrprof-shared-main-gcov-flush.gcda instrprof-shared-lib.gcda
-RUN: %run %t
-RUN: llvm-cov gcov instrprof-shared-main-gcov-flush.gcda
-RUN: FileCheck --match-full-lines --strict-whitespace --input-file instrprof-shared-main-gcov-flush.c.gcov %S/../Inputs/instrprof-shared-main-gcov-flush_no-writeout.c.gcov
-RUN: llvm-cov gcov instrprof-shared-lib.gcda
-RUN: FileCheck --match-full-lines --strict-whitespace --input-file instrprof-shared-lib.c.gcov %S/../Inputs/instrprof-shared-lib.c.gcov
-
-# Test the case where we exit normally and we have a call to the shared library function before __gcov_flush.
-RUN: %clang -DSHARED_CALL_BEFORE_GCOV_FLUSH --coverage -o %t -L%t.d -rpath %t.d -lfunc %S/../Inputs/instrprof-shared-main-gcov-flush.c
-RUN: test -f instrprof-shared-main-gcov-flush.gcno
-
-RUN: rm -f instrprof-shared-main-gcov-flush.gcda instrprof-shared-lib.gcda
-RUN: %run %t
-RUN: llvm-cov gcov instrprof-shared-main-gcov-flush.gcda
-RUN: FileCheck --match-full-lines --strict-whitespace --input-file instrprof-shared-main-gcov-flush.c.gcov %S/../Inputs/instrprof-shared-main-gcov-flush_shared-call-before.c.gcov
-RUN: llvm-cov gcov instrprof-shared-lib.gcda
-RUN: FileCheck --match-full-lines --strict-whitespace --input-file instrprof-shared-lib.c.gcov %S/../Inputs/instrprof-shared-lib.c.gcov
-
-# Test the case where we exit normally and we have a call to the shared library function after __gcov_flush.
-RUN: %clang -DSHARED_CALL_AFTER_GCOV_FLUSH --coverage -o %t -L%t.d -rpath %t.d -lfunc %S/../Inputs/instrprof-shared-main-gcov-flush.c
-RUN: test -f instrprof-shared-main-gcov-flush.gcno
-
-RUN: rm -f instrprof-shared-main-gcov-flush.gcda instrprof-shared-lib.gcda
-RUN: %run %t
-RUN: llvm-cov gcov instrprof-shared-main-gcov-flush.gcda
-RUN: FileCheck --match-full-lines --strict-whitespace --input-file instrprof-shared-main-gcov-flush.c.gcov %S/../Inputs/instrprof-shared-main-gcov-flush_shared-call-after.c.gcov
-RUN: llvm-cov gcov instrprof-shared-lib.gcda
-RUN: FileCheck --match-full-lines --strict-whitespace --input-file instrprof-shared-lib.c.gcov %S/../Inputs/instrprof-shared-lib.c.gcov
-
-# Test the case where we exit normally and we have calls to the shared library function before and after __gcov_flush.
-RUN: %clang -DSHARED_CALL_BEFORE_GCOV_FLUSH -DSHARED_CALL_AFTER_GCOV_FLUSH --coverage -o %t -L%t.d -rpath %t.d -lfunc %S/../Inputs/instrprof-shared-main-gcov-flush.c
-RUN: test -f instrprof-shared-main-gcov-flush.gcno
-
-RUN: rm -f instrprof-shared-main-gcov-flush.gcda instrprof-shared-lib.gcda
-RUN: %run %t
-RUN: llvm-cov gcov instrprof-shared-main-gcov-flush.gcda
-RUN: FileCheck --match-full-lines --strict-whitespace --input-file instrprof-shared-main-gcov-flush.c.gcov %S/../Inputs/instrprof-shared-main-gcov-flush_shared-call-before-after.c.gcov
-RUN: llvm-cov gcov instrprof-shared-lib.gcda
-RUN: FileCheck --match-full-lines --strict-whitespace --input-file instrprof-shared-lib.c.gcov %S/../Inputs/instrprof-shared-lib_called-twice.c.gcov
diff --git a/compiler-rt/test/profile/gcov-__gcov_flush-terminate.c b/compiler-rt/test/profile/gcov-__gcov_flush-terminate.c
index c0c443c0e9dd..5303e045063e 100644
--- a/compiler-rt/test/profile/gcov-__gcov_flush-terminate.c
+++ b/compiler-rt/test/profile/gcov-__gcov_flush-terminate.c
@@ -9,23 +9,14 @@
// CHECK: -: 0:Runs:1
// CHECK-NEXT: -: 0:Programs:1
-// CHECK: -: 1:void __gcov_flush(void);
-// CHECK-NEXT: -: 2:
-// CHECK-NEXT: 1: 3:int main(void) {
-// CHECK-NEXT: 1: 4: int i = 22;
-// CHECK-NEXT: 1: 5: __gcov_flush();
-// CHECK-NEXT: 1: 6: i = 42;
-// CHECK-NEXT: 1: 7: __builtin_trap();
-// CHECK-NEXT: 1: 8: i = 84;
-// CHECK-NEXT: 1: 9: return 0;
void __gcov_flush(void);
-int main(void) {
- int i = 22;
- __gcov_flush();
- i = 42;
- __builtin_trap();
- i = 84;
- return 0;
+int main(void) { // CHECK: 1: [[#@LINE]]:int main(void)
+ int i = 22; // CHECK-NEXT: 1: [[#@LINE]]:
+ __gcov_flush(); // CHECK-NEXT: 1: [[#@LINE]]:
+ i = 42; // CHECK-NEXT: 1: [[#@LINE]]:
+ __builtin_trap(); // CHECK-NEXT: 1: [[#@LINE]]:
+ i = 84; // CHECK-NEXT: 1: [[#@LINE]]:
+ return 0; // CHECK-NEXT: 1: [[#@LINE]]:
}
diff --git a/compiler-rt/test/profile/gcov-dump-and-remove.c b/compiler-rt/test/profile/gcov-dump-and-remove.c
new file mode 100644
index 000000000000..1dcf7b5bd5ca
--- /dev/null
+++ b/compiler-rt/test/profile/gcov-dump-and-remove.c
@@ -0,0 +1,24 @@
+/// Test we close file handle on flush, so the .gcda file can be deleted on
+/// Windows while the process is still running. In addition, test we create
+/// a new .gcda on flush, so there is a file when the process exists.
+// RUN: mkdir -p %t.d && cd %t.d
+// RUN: %clang --coverage -o %t %s
+// RUN: test -f gcov-dump-and-remove.gcno
+
+// RUN: rm -f gcov-dump-and-remove.gcda && %run %t
+// RUN: llvm-cov gcov -t gcov-dump-and-remove.gcda | FileCheck %s
+
+extern void __gcov_flush(void);
+extern int remove(const char *); // CHECK: -: [[#@LINE]]:extern int remove
+int main(void) { // CHECK-NEXT: #####: [[#@LINE]]:
+ __gcov_flush(); // CHECK-NEXT: #####: [[#@LINE]]:
+ if (remove("gcov-dump-and-remove.gcda") != 0) // CHECK-NEXT: #####: [[#@LINE]]:
+ return 1; // CHECK-NEXT: #####: [[#@LINE]]: return 1;
+ // CHECK-NEXT: -: [[#@LINE]]:
+ __gcov_flush(); // CHECK-NEXT: #####: [[#@LINE]]:
+ __gcov_flush(); // CHECK-NEXT: #####: [[#@LINE]]:
+ if (remove("gcov-dump-and-remove.gcda") != 0) // CHECK-NEXT: #####: [[#@LINE]]:
+ return 1; // CHECK-NEXT: #####: [[#@LINE]]: return 1;
+
+ return 0;
+}
diff --git a/compiler-rt/test/profile/instrprof-gcov-__gcov_flush-multiple.test b/compiler-rt/test/profile/instrprof-gcov-__gcov_flush-multiple.test
deleted file mode 100644
index fdc93c93e0b0..000000000000
--- a/compiler-rt/test/profile/instrprof-gcov-__gcov_flush-multiple.test
+++ /dev/null
@@ -1,10 +0,0 @@
-RUN: mkdir -p %t.d
-RUN: cd %t.d
-
-RUN: %clang --coverage -o %t %S/Inputs/instrprof-gcov-__gcov_flush-multiple.c
-RUN: test -f instrprof-gcov-__gcov_flush-multiple.gcno
-
-RUN: rm -f instrprof-gcov-__gcov_flush-multiple.gcda
-RUN: %run %t
-RUN: llvm-cov gcov instrprof-gcov-__gcov_flush-multiple.gcda
-RUN: FileCheck --match-full-lines --strict-whitespace --input-file instrprof-gcov-__gcov_flush-multiple.c.gcov %S/Inputs/instrprof-gcov-__gcov_flush-multiple.c.gcov
More information about the llvm-commits
mailing list