<div dir="ltr">I've reverted this commit since it causes buildbots failures. It did work locally, so I will have to investigate why the test fails on the buildbots.</div><div class="gmail_extra"><br><div class="gmail_quote">2014-09-30 13:52 GMT+01:00 Alex Lorenz <span dir="ltr"><<a href="mailto:arphaman@gmail.com" target="_blank">arphaman@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: arphaman<br>
Date: Tue Sep 30 07:52:31 2014<br>
New Revision: 218673<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=218673&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=218673&view=rev</a><br>
Log:<br>
llvm-cov: add test for report's function & file association.<br>
<br>
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.<br>
<br>
Differential Revision: <a href="http://reviews.llvm.org/D5489" target="_blank">http://reviews.llvm.org/D5489</a><br>
<br>
Added:<br>
    llvm/trunk/test/tools/llvm-cov/Inputs/reportFunctionPlacement.covmapping   (with props)<br>
    llvm/trunk/test/tools/llvm-cov/Inputs/reportFunctionPlacement.h<br>
    llvm/trunk/test/tools/llvm-cov/Inputs/reportFunctionPlacement.profdata   (with props)<br>
    llvm/trunk/test/tools/llvm-cov/reportFunctionPlacement.cpp<br>
<br>
Added: llvm/trunk/test/tools/llvm-cov/Inputs/reportFunctionPlacement.covmapping<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-cov/Inputs/reportFunctionPlacement.covmapping?rev=218673&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-cov/Inputs/reportFunctionPlacement.covmapping?rev=218673&view=auto</a><br>
==============================================================================<br>
Binary file - no diff available.<br>
<br>
Propchange: llvm/trunk/test/tools/llvm-cov/Inputs/reportFunctionPlacement.covmapping<br>
------------------------------------------------------------------------------<br>
    svn:mime-type = application/octet-stream<br>
<br>
Added: llvm/trunk/test/tools/llvm-cov/Inputs/reportFunctionPlacement.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-cov/Inputs/reportFunctionPlacement.h?rev=218673&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-cov/Inputs/reportFunctionPlacement.h?rev=218673&view=auto</a><br>
==============================================================================<br>
--- llvm/trunk/test/tools/llvm-cov/Inputs/reportFunctionPlacement.h (added)<br>
+++ llvm/trunk/test/tools/llvm-cov/Inputs/reportFunctionPlacement.h Tue Sep 30 07:52:31 2014<br>
@@ -0,0 +1,8 @@<br>
+<br>
+void foo(int x) {<br>
+  int y = x + 1;<br>
+}<br>
+<br>
+void bar() {<br>
+<br>
+}<br>
<br>
Added: llvm/trunk/test/tools/llvm-cov/Inputs/reportFunctionPlacement.profdata<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-cov/Inputs/reportFunctionPlacement.profdata?rev=218673&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-cov/Inputs/reportFunctionPlacement.profdata?rev=218673&view=auto</a><br>
==============================================================================<br>
Binary file - no diff available.<br>
<br>
Propchange: llvm/trunk/test/tools/llvm-cov/Inputs/reportFunctionPlacement.profdata<br>
------------------------------------------------------------------------------<br>
    svn:mime-type = application/octet-stream<br>
<br>
Added: llvm/trunk/test/tools/llvm-cov/reportFunctionPlacement.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-cov/reportFunctionPlacement.cpp?rev=218673&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-cov/reportFunctionPlacement.cpp?rev=218673&view=auto</a><br>
==============================================================================<br>
--- llvm/trunk/test/tools/llvm-cov/reportFunctionPlacement.cpp (added)<br>
+++ llvm/trunk/test/tools/llvm-cov/reportFunctionPlacement.cpp Tue Sep 30 07:52:31 2014<br>
@@ -0,0 +1,24 @@<br>
+// RUN: llvm-cov report %S/Inputs/reportFunctionPlacement.covmapping -instr-profile %S/Inputs/reportFunctionPlacement.profdata -no-colors 2>&1 | FileCheck %s<br>
+// This test checks that the functions defined in header files will get<br>
+// associated with header files rather than source files for the reports.<br>
+<br>
+#include "Inputs/reportFunctionPlacement.h"<br>
+<br>
+// CHECK: Filename                    Regions    Miss   Cover Functions  Executed<br>
+// CHECK: ---<br>
+// CHECK: ...ortFunctionPlacement.h         2       1  50.00%         2    50.00%<br>
+// CHECK: ...tFunctionPlacement.cpp         2       0 100.00%         2   100.00%<br>
+// CHECK: ---<br>
+// CHECK: TOTAL                             4       1  75.00%         4    75.00%<br>
+<br>
+void func() {<br>
+}<br>
+<br>
+int main() {<br>
+  foo(10);<br>
+  func();<br>
+  return 0;<br>
+}<br>
+<br>
+// llvm-cov doesn't work on big endian yet<br>
+// XFAIL: powerpc64-, s390x, mips-, mips64-, sparc<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div>