[PATCH] Tests for coverage mapping
Reid Kleckner
rnk at google.com
Tue Aug 5 12:00:51 PDT 2014
================
Comment at: test/CoverageMapping/break.c:3
@@ +2,3 @@
+// RUN: %clang %s -fprofile-instr-generate -fcoverage-mapping -O2 -o %t/test
+// RUN: (cd %t; %t/test)
+// RUN: llvm-profdata merge %t/default.profraw -o %t/pgodata
----------------
Alex Lorenz wrote:
> Reid Kleckner wrote:
> > I don't think we allow execution tests in Clang's internal test suite. Can this live in test-suite?
> I can take out the execution part then, so it will look something like this:
>
> // RUN: %clang %s -fprofile-instr-generate -fcoverage-mapping -O2 -o %stest
> // RUN: llvm-cov dump %stest| FileCheck %s
Even this test would rely on having a system linker that can link a binary for LLVM_DEFAULT_TARGET_TRIPLE, which might not be a native architecture. Can llvm-cov -dump run on an object file? Is that a useful test?
This kind of large execution test for coverage seems valuable, but I don't think we can reasonably expect it to pass in every supported configuration. It seems to me like it's a better fit for test-suite. We can definitely keep the IRGen tests, though.
================
Comment at: test/CoverageMapping/code.h:1
@@ +1,2 @@
+x = x;
+if (x == 0) {
----------------
This would have to be in Inputs/
================
Comment at: test/CoverageMapping/tu2.cpp:1
@@ +1,2 @@
+// This isn't actually a test, this file is part of the test described by tu1.cpp
+// RUN: true
----------------
This would have to be in Inputs/
http://reviews.llvm.org/D4793
More information about the cfe-commits
mailing list