diff options
| author | Alex Lorenz <arphaman@gmail.com> | 2014-09-30 12:52:31 +0000 |
|---|---|---|
| committer | Alex Lorenz <arphaman@gmail.com> | 2014-09-30 12:52:31 +0000 |
| commit | a891e6d44aee33cf0100eef127afcde5f7acd6e1 (patch) | |
| tree | 1a7c259d1c6de7e3e5e09fdedf72ae11200677cd /llvm | |
| parent | cb1702d45a433689f297567b1bcba03378bbd9f2 (diff) | |
| download | bcm5719-llvm-a891e6d44aee33cf0100eef127afcde5f7acd6e1.tar.gz bcm5719-llvm-a891e6d44aee33cf0100eef127afcde5f7acd6e1.zip | |
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
llvm-svn: 218673
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/test/tools/llvm-cov/Inputs/reportFunctionPlacement.covmapping | bin | 0 -> 352 bytes | |||
| -rw-r--r-- | llvm/test/tools/llvm-cov/Inputs/reportFunctionPlacement.h | 8 | ||||
| -rw-r--r-- | llvm/test/tools/llvm-cov/Inputs/reportFunctionPlacement.profdata | bin | 0 -> 792 bytes | |||
| -rw-r--r-- | llvm/test/tools/llvm-cov/reportFunctionPlacement.cpp | 24 |
4 files changed, 32 insertions, 0 deletions
diff --git a/llvm/test/tools/llvm-cov/Inputs/reportFunctionPlacement.covmapping b/llvm/test/tools/llvm-cov/Inputs/reportFunctionPlacement.covmapping Binary files differnew file mode 100644 index 00000000000..51a5ba2c3d5 --- /dev/null +++ b/llvm/test/tools/llvm-cov/Inputs/reportFunctionPlacement.covmapping diff --git a/llvm/test/tools/llvm-cov/Inputs/reportFunctionPlacement.h b/llvm/test/tools/llvm-cov/Inputs/reportFunctionPlacement.h new file mode 100644 index 00000000000..9280e039bdc --- /dev/null +++ b/llvm/test/tools/llvm-cov/Inputs/reportFunctionPlacement.h @@ -0,0 +1,8 @@ + +void foo(int x) { + int y = x + 1; +} + +void bar() { + +} diff --git a/llvm/test/tools/llvm-cov/Inputs/reportFunctionPlacement.profdata b/llvm/test/tools/llvm-cov/Inputs/reportFunctionPlacement.profdata Binary files differnew file mode 100644 index 00000000000..eec54935a14 --- /dev/null +++ b/llvm/test/tools/llvm-cov/Inputs/reportFunctionPlacement.profdata diff --git a/llvm/test/tools/llvm-cov/reportFunctionPlacement.cpp b/llvm/test/tools/llvm-cov/reportFunctionPlacement.cpp new file mode 100644 index 00000000000..fef945d257e --- /dev/null +++ b/llvm/test/tools/llvm-cov/reportFunctionPlacement.cpp @@ -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 |

