nestedclass.cpp 991 B

12345678910111213141516171819202122232425262728
  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. struct Test { // CHECK-OUTER: emitTest
  6. void emitTest() { // CHECK-OUTER: File 0, [[@LINE]]:19 -> [[@LINE+2]]:4 = #0
  7. int i = 0;
  8. }
  9. struct Test2 { // CHECK-INNER: emitTest2
  10. void emitTest2() { // CHECK-INNER: File 0, [[@LINE]]:22 -> [[@LINE+2]]:6 = #0
  11. int i = 0;
  12. }
  13. struct Test3 { // CHECK-INNERMOST: emitTest3
  14. static void emitTest3() { // CHECK-INNERMOST: File 0, [[@LINE]]:31 -> [[@LINE+2]]:8 = 0
  15. int i = 0;
  16. }
  17. };
  18. };
  19. };
  20. int main() {
  21. Test t;
  22. Test::Test2 t2;
  23. t.emitTest();
  24. t2.emitTest2();
  25. return 0;
  26. }