showRegionMarkers.cpp 1.4 KB

12345678910111213141516171819202122232425262728
  1. // RUN: llvm-profdata merge %S/Inputs/regionMarkers.proftext -o %t.profdata
  2. int main() { // CHECK-NOT: Marker at [[@LINE]]:12
  3. int x = 0;
  4. if (x) { // CHECK-NOT: Marker at [[@LINE]]:10
  5. x = 0;
  6. } else { // CHECK-NOT: Marker at [[@LINE]]:10
  7. x = 1;
  8. }
  9. // CHECK: Marker at [[@LINE+2]]:19 = 112M
  10. // CHECK: Marker at [[@LINE+1]]:28 = 111M
  11. for (int i = 0; i < 100; ++i) { // CHECK-NOT: Marker at [[@LINE]]:33
  12. x = 1;
  13. }
  14. // CHECK: Marker at [[@LINE+1]]:16 = 1.11M
  15. x = x < 10 ? x + 1 : x - 1; // CHECK: Marker at [[@LINE]]:24 = 0
  16. x = x > 10 ?
  17. x - 1: // CHECK-NOT: Marker at [[@LINE]]:9
  18. x + 1; // CHECK-NOT: Marker at [[@LINE]]:9
  19. return 0;
  20. }
  21. // RUN: llvm-cov show %S/Inputs/regionMarkers.covmapping -instr-profile %t.profdata -show-regions -dump -path-equivalence=/Users/bogner/code/llvm/test/tools,%S/.. %s 2>&1 | FileCheck %s
  22. // RUN: llvm-cov show %S/Inputs/regionMarkers.covmapping -instr-profile %t.profdata -show-regions -format=html -dump -path-equivalence=/Users/bogner/code/llvm/test/tools,%S/.. %s 2>&1 | FileCheck %s
  23. // RUN: llvm-cov export %S/Inputs/regionMarkers.covmapping -instr-profile %t.profdata 2>&1 | FileCheck %S/Inputs/regionMarkers.json