summaryrefslogtreecommitdiff
path: root/test/tools/llvm-cov/llvm-cov.test
diff options
context:
space:
mode:
authorJustin Bogner <mail@justinbogner.com>2014-02-18 09:19:48 +0000
committerJustin Bogner <mail@justinbogner.com>2014-02-18 09:19:48 +0000
commit257ed1ed698011f1c23f47ca4f1c5f4cf4efbd41 (patch)
tree4d66767d3ac43acc942dd93e6564e2cdade8f05e /test/tools/llvm-cov/llvm-cov.test
parentce3db3cdb2b0dbd725937814f732f564d42db318 (diff)
downloadllvm-257ed1ed698011f1c23f47ca4f1c5f4cf4efbd41.tar.gz
llvm-257ed1ed698011f1c23f47ca4f1c5f4cf4efbd41.tar.bz2
llvm-257ed1ed698011f1c23f47ca4f1c5f4cf4efbd41.tar.xz
llvm-cov: Support gcov's extermely lenient treatment of -o
In gcov, the -o flag can accept either a directory or a file name. When given a directory, the gcda and gcno files are expected to be in that directory. When given a file, the gcda and gcno files are expected to be named based on the stem of that file. Non-existent paths are treated as files. This implements compatible behaviour. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201555 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/tools/llvm-cov/llvm-cov.test')
-rw-r--r--test/tools/llvm-cov/llvm-cov.test10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/tools/llvm-cov/llvm-cov.test b/test/tools/llvm-cov/llvm-cov.test
index c52a981522..afd657be24 100644
--- a/test/tools/llvm-cov/llvm-cov.test
+++ b/test/tools/llvm-cov/llvm-cov.test
@@ -21,6 +21,16 @@ RUN: llvm-cov -o objdir test.c | diff -u test_no_options.output -
RUN: diff -aub test_objdir.cpp.gcov test.cpp.gcov
RUN: diff -aub test_objdir.h.gcov test.h.gcov
+# Specifying an object file
+RUN: llvm-cov -o objdir/test.o test.c | diff -u test_no_options.output -
+RUN: diff -aub test_objdir.cpp.gcov test.cpp.gcov
+RUN: diff -aub test_objdir.h.gcov test.h.gcov
+
+# Specifying an object file that could be ambiguous with a directory
+RUN: llvm-cov -o objdir/test test.c | diff -u test_no_options.output -
+RUN: diff -aub test_objdir.cpp.gcov test.cpp.gcov
+RUN: diff -aub test_objdir.h.gcov test.h.gcov
+
# Preserve paths. This mangles the output filenames.
RUN: mkdir -p %t/srcdir/nested_dir
RUN: cp test.cpp test.h %t/srcdir