summaryrefslogtreecommitdiffstats
path: root/llvm/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
commite9a3e5a93e1c52844dfb122e45c2afb16121d5b7 (patch)
tree427299b08153cb6e4cadb6e382ee81c6aecdb441 /llvm/test/tools/llvm-cov/llvm-cov.test
parent67bf8bd124f39734c94a1ed81bb3804de51ca789 (diff)
downloadbcm5719-llvm-e9a3e5a93e1c52844dfb122e45c2afb16121d5b7.tar.gz
bcm5719-llvm-e9a3e5a93e1c52844dfb122e45c2afb16121d5b7.zip
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. llvm-svn: 201555
Diffstat (limited to 'llvm/test/tools/llvm-cov/llvm-cov.test')
-rw-r--r--llvm/test/tools/llvm-cov/llvm-cov.test10
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/test/tools/llvm-cov/llvm-cov.test b/llvm/test/tools/llvm-cov/llvm-cov.test
index c52a9815229..afd657be249 100644
--- a/llvm/test/tools/llvm-cov/llvm-cov.test
+++ b/llvm/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
OpenPOWER on IntegriCloud