xref: /minix3/external/bsd/llvm/dist/clang/test/CoverageMapping/nestedclass.cpp (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -fprofile-instr-generate -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -main-file-name nestedclass.cpp %s > %tmapping
2*0a6a1f1dSLionel Sambuc // RUN: FileCheck -input-file %tmapping %s --check-prefix=CHECK-OUTER
3*0a6a1f1dSLionel Sambuc // RUN: FileCheck -input-file %tmapping %s --check-prefix=CHECK-INNER
4*0a6a1f1dSLionel Sambuc // RUN: FileCheck -input-file %tmapping %s --check-prefix=CHECK-INNERMOST
5*0a6a1f1dSLionel Sambuc 
6*0a6a1f1dSLionel Sambuc struct Test {                   // CHECK-OUTER: emitTest
emitTestTest7*0a6a1f1dSLionel Sambuc   void emitTest() {             // CHECK-OUTER: File 0, [[@LINE]]:19 -> [[@LINE+2]]:4 = #0 (HasCodeBefore = 0)
8*0a6a1f1dSLionel Sambuc     int i = 0;
9*0a6a1f1dSLionel Sambuc   }
10*0a6a1f1dSLionel Sambuc   struct Test2 {                // CHECK-INNER: emitTest2
emitTest2Test::Test211*0a6a1f1dSLionel Sambuc     void emitTest2() {          // CHECK-INNER: File 0, [[@LINE]]:22 -> [[@LINE+2]]:6 = #0 (HasCodeBefore = 0)
12*0a6a1f1dSLionel Sambuc       int i = 0;
13*0a6a1f1dSLionel Sambuc     }
14*0a6a1f1dSLionel Sambuc     struct Test3 {              // CHECK-INNERMOST: emitTest3
emitTest3Test::Test2::Test315*0a6a1f1dSLionel Sambuc       static void emitTest3() { // CHECK-INNERMOST: File 0, [[@LINE]]:31 -> [[@LINE+2]]:8 = 0 (HasCodeBefore = 0)
16*0a6a1f1dSLionel Sambuc         int i = 0;
17*0a6a1f1dSLionel Sambuc       }
18*0a6a1f1dSLionel Sambuc     };
19*0a6a1f1dSLionel Sambuc   };
20*0a6a1f1dSLionel Sambuc };
21*0a6a1f1dSLionel Sambuc 
main()22*0a6a1f1dSLionel Sambuc int main() {
23*0a6a1f1dSLionel Sambuc   Test t;
24*0a6a1f1dSLionel Sambuc   Test::Test2 t2;
25*0a6a1f1dSLionel Sambuc   t.emitTest();
26*0a6a1f1dSLionel Sambuc   t2.emitTest2();
27*0a6a1f1dSLionel Sambuc   return 0;
28*0a6a1f1dSLionel Sambuc }
29