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