summaryrefslogtreecommitdiff
path: root/compiler-rt/test/profile/Posix/gcov-shared-flush.c
diff options
context:
space:
mode:
authorFangrui Song <i@maskray.me>2023-05-17 11:54:38 -0700
committerFangrui Song <i@maskray.me>2023-05-17 11:54:38 -0700
commit0f9f2473613519b18004158835914bc25fcb2b40 (patch)
treeea067b1a3268eb34e180c147bf1fe372ab1684ef /compiler-rt/test/profile/Posix/gcov-shared-flush.c
parentda42b2846c82063bd1bce78d6a046f78f218eb72 (diff)
downloadllvm-0f9f2473613519b18004158835914bc25fcb2b40.tar.gz
[gcov][test] Add -dumpdir ./
These tests rely on an unintended behavior that when the driver performs both compilation and linking phases, the .gcno & .gcda files are placed in PWD. The behavior will be fixed to respect -o (match -ftime-trace, -gsplit-dwarf, and GCC). Add -dumpdir ./ so that the tests will work with or without the behavior change, and make it easy to compare the coverage behavior with GCC.
Diffstat (limited to 'compiler-rt/test/profile/Posix/gcov-shared-flush.c')
-rw-r--r--compiler-rt/test/profile/Posix/gcov-shared-flush.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/compiler-rt/test/profile/Posix/gcov-shared-flush.c b/compiler-rt/test/profile/Posix/gcov-shared-flush.c
index 5604558509f9..40e3159dcb28 100644
--- a/compiler-rt/test/profile/Posix/gcov-shared-flush.c
+++ b/compiler-rt/test/profile/Posix/gcov-shared-flush.c
@@ -3,12 +3,12 @@
// 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: %clang -E -DSHARED %s -o shared.c -dumpdir ./
+// RUN: %clang --coverage -fPIC -shared shared.c -o libfunc.so -dumpdir ./
// RUN: test -f shared.gcno
/// Test the case where we exit abruptly after calling __gcov_dump, 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: %clang -DEXIT_ABRUPTLY -DSHARED_CALL_BEFORE_FLUSH -DSHARED_CALL_AFTER_FLUSH --coverage %s -L%t.d -rpath %t.d -lfunc -o %t -dumpdir ./
// RUN: test -f gcov-shared-flush.gcno
// RUN: rm -f gcov-shared-flush.gcda shared.gcda
@@ -22,7 +22,7 @@
// 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_dump.
-// RUN: %clang -DSHARED_CALL_BEFORE_FLUSH --coverage %s -L%t.d -rpath %t.d -lfunc -o %t
+// RUN: %clang -DSHARED_CALL_BEFORE_FLUSH --coverage %s -L%t.d -rpath %t.d -lfunc -o %t -dumpdir ./
// RUN: test -f gcov-shared-flush.gcno
// RUN: rm -f gcov-shared-flush.gcda shared.gcda
@@ -41,7 +41,7 @@
// 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_dump.
-// RUN: %clang -DSHARED_CALL_AFTER_FLUSH --coverage %s -L%t.d -rpath %t.d -lfunc -o %t
+// RUN: %clang -DSHARED_CALL_AFTER_FLUSH --coverage %s -L%t.d -rpath %t.d -lfunc -o %t -dumpdir ./
// RUN: test -f gcov-shared-flush.gcno
// RUN: rm -f gcov-shared-flush.gcda shared.gcda
@@ -58,7 +58,7 @@
// 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_dump.
-// RUN: %clang -DSHARED_CALL_BEFORE_FLUSH -DSHARED_CALL_AFTER_FLUSH --coverage %s -L%t.d -rpath %t.d -lfunc -o %t
+// RUN: %clang -DSHARED_CALL_BEFORE_FLUSH -DSHARED_CALL_AFTER_FLUSH --coverage %s -L%t.d -rpath %t.d -lfunc -o %t -dumpdir ./
// RUN: test -f gcov-shared-flush.gcno
// RUN: rm -f gcov-shared-flush.gcda shared.gcda