From c92330c18ce2f7015f0db88e4bfce3d253fa3c57 Mon Sep 17 00:00:00 2001 From: Justin Bogner Date: Wed, 7 May 2014 02:11:23 +0000 Subject: llvm-cov: Handle missing source files as GCOV does If the source files referenced by a gcno file are missing, gcov outputs a coverage file where every line is simply /*EOF*/. This also occurs for lines in the coverage that are past the end of a file that is found. This change mimics gcov. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208149 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/tools/llvm-cov/llvm-cov.test | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test/tools/llvm-cov/llvm-cov.test') diff --git a/test/tools/llvm-cov/llvm-cov.test b/test/tools/llvm-cov/llvm-cov.test index 8f57d9a189..2345f8d51e 100644 --- a/test/tools/llvm-cov/llvm-cov.test +++ b/test/tools/llvm-cov/llvm-cov.test @@ -34,6 +34,12 @@ RUN: diff -aub test_objdir.h.gcov test.h.gcov # With gcov output disabled RUN: llvm-cov -n test.c | diff -u test_no_output.output - +# Missing source files. This test is fragile, as it depends on being +# run before we copy some sources into place in the next test. +RUN: llvm-cov test_paths.cpp 2>/dev/null | diff -u test_missing.output - +RUN: diff -aub test_missing.cpp.gcov test.cpp.gcov +RUN: diff -aub test_missing.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 -- cgit v1.2.3