[llvm] r218673 - llvm-cov: add test for report's function & file association.
Alex Lorenz
arphaman at gmail.com
Tue Sep 30 05:52:32 PDT 2014
Author: arphaman
Date: Tue Sep 30 07:52:31 2014
New Revision: 218673
URL: http://llvm.org/viewvc/llvm-project?rev=218673&view=rev
Log:
llvm-cov: add test for report's function & file association.
This commit adds a test which checks that the functions defined in header files will get associated with the header files rather than the source files in the reports.
Differential Revision: http://reviews.llvm.org/D5489
Added:
llvm/trunk/test/tools/llvm-cov/Inputs/reportFunctionPlacement.covmapping (with props)
llvm/trunk/test/tools/llvm-cov/Inputs/reportFunctionPlacement.h
llvm/trunk/test/tools/llvm-cov/Inputs/reportFunctionPlacement.profdata (with props)
llvm/trunk/test/tools/llvm-cov/reportFunctionPlacement.cpp
Added: llvm/trunk/test/tools/llvm-cov/Inputs/reportFunctionPlacement.covmapping
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-cov/Inputs/reportFunctionPlacement.covmapping?rev=218673&view=auto
==============================================================================
Binary file - no diff available.
Propchange: llvm/trunk/test/tools/llvm-cov/Inputs/reportFunctionPlacement.covmapping
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: llvm/trunk/test/tools/llvm-cov/Inputs/reportFunctionPlacement.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-cov/Inputs/reportFunctionPlacement.h?rev=218673&view=auto
==============================================================================
--- llvm/trunk/test/tools/llvm-cov/Inputs/reportFunctionPlacement.h (added)
+++ llvm/trunk/test/tools/llvm-cov/Inputs/reportFunctionPlacement.h Tue Sep 30 07:52:31 2014
@@ -0,0 +1,8 @@
+
+void foo(int x) {
+ int y = x + 1;
+}
+
+void bar() {
+
+}
Added: llvm/trunk/test/tools/llvm-cov/Inputs/reportFunctionPlacement.profdata
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-cov/Inputs/reportFunctionPlacement.profdata?rev=218673&view=auto
==============================================================================
Binary file - no diff available.
Propchange: llvm/trunk/test/tools/llvm-cov/Inputs/reportFunctionPlacement.profdata
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: llvm/trunk/test/tools/llvm-cov/reportFunctionPlacement.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-cov/reportFunctionPlacement.cpp?rev=218673&view=auto
==============================================================================
--- llvm/trunk/test/tools/llvm-cov/reportFunctionPlacement.cpp (added)
+++ llvm/trunk/test/tools/llvm-cov/reportFunctionPlacement.cpp Tue Sep 30 07:52:31 2014
@@ -0,0 +1,24 @@
+// RUN: llvm-cov report %S/Inputs/reportFunctionPlacement.covmapping -instr-profile %S/Inputs/reportFunctionPlacement.profdata -no-colors 2>&1 | FileCheck %s
+// This test checks that the functions defined in header files will get
+// associated with header files rather than source files for the reports.
+
+#include "Inputs/reportFunctionPlacement.h"
+
+// CHECK: Filename Regions Miss Cover Functions Executed
+// CHECK: ---
+// CHECK: ...ortFunctionPlacement.h 2 1 50.00% 2 50.00%
+// CHECK: ...tFunctionPlacement.cpp 2 0 100.00% 2 100.00%
+// CHECK: ---
+// CHECK: TOTAL 4 1 75.00% 4 75.00%
+
+void func() {
+}
+
+int main() {
+ foo(10);
+ func();
+ return 0;
+}
+
+// llvm-cov doesn't work on big endian yet
+// XFAIL: powerpc64-, s390x, mips-, mips64-, sparc
More information about the llvm-commits
mailing list