diff options
author | Alex Lorenz <arphaman@gmail.com> | 2014-08-19 17:32:30 +0000 |
---|---|---|
committer | Alex Lorenz <arphaman@gmail.com> | 2014-08-19 17:32:30 +0000 |
commit | 34ac9b5e25d3a00197ad30238d4e213f7811ebfe (patch) | |
tree | 5c632b3b63a03fa4148853693eaa68bbedc608b8 /clang/test/CoverageMapping/nestedclass.cpp | |
parent | dd6394d83344a3f61ddcf9fa0804308146d6b888 (diff) | |
download | bcm5719-llvm-34ac9b5e25d3a00197ad30238d4e213f7811ebfe.tar.gz bcm5719-llvm-34ac9b5e25d3a00197ad30238d4e213f7811ebfe.zip |
Add tests for coverage mapping generation.
This patch adds the tests for the coverage mapping generation.
Most of the tests check the mapping regions produced by
the generator, and one checks the llvm IR.
Differential Revision: http://reviews.llvm.org/D4847
llvm-svn: 215995
Diffstat (limited to 'clang/test/CoverageMapping/nestedclass.cpp')
-rw-r--r-- | clang/test/CoverageMapping/nestedclass.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/clang/test/CoverageMapping/nestedclass.cpp b/clang/test/CoverageMapping/nestedclass.cpp new file mode 100644 index 00000000000..6462eca7cf8 --- /dev/null +++ b/clang/test/CoverageMapping/nestedclass.cpp @@ -0,0 +1,28 @@ +// RUN: %clang_cc1 -fprofile-instr-generate -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -main-file-name nestedclass.cpp %s > %tmapping +// RUN: cat %tmapping | FileCheck %s --check-prefix=CHECK-OUTER +// RUN: cat %tmapping | FileCheck %s --check-prefix=CHECK-INNER +// RUN: cat %tmapping | FileCheck %s --check-prefix=CHECK-INNERMOST + +struct Test { // CHECK-OUTER: emitTest + void emitTest() { // CHECK-OUTER: File 0, [[@LINE]]:19 -> [[@LINE+2]]:4 = #0 (HasCodeBefore = 0) + int i = 0; + } + struct Test2 { // CHECK-INNER: emitTest2 + void emitTest2() { // CHECK-INNER: File 0, [[@LINE]]:22 -> [[@LINE+2]]:6 = #0 (HasCodeBefore = 0) + int i = 0; + } + struct Test3 { // CHECK-INNERMOST: emitTest3 + static void emitTest3() { // CHECK-INNERMOST: File 0, [[@LINE]]:31 -> [[@LINE+2]]:8 = 0 (HasCodeBefore = 0) + int i = 0; + } + }; + }; +}; + +int main() { + Test t; + Test::Test2 t2; + t.emitTest(); + t2.emitTest2(); + return 0; +} |