InstrProf: Always emit a coverage region for the condition of an if
When tools like llvm-cov show regions, it's much easier to understand
what's happening if the condition of an if shows a counter as well as
the body.
llvm-svn: 229813
diff --git a/clang/test/CoverageMapping/trycatch.cpp b/clang/test/CoverageMapping/trycatch.cpp
index cd65334..696df54 100644
--- a/clang/test/CoverageMapping/trycatch.cpp
+++ b/clang/test/CoverageMapping/trycatch.cpp
@@ -10,10 +10,11 @@
};
// CHECK: func
-void func(int i) { // CHECK-NEXT: File 0, [[@LINE]]:18 -> [[@LINE+5]]:2 = #0
- if(i % 2)
+void func(int i) { // CHECK-NEXT: File 0, [[@LINE]]:18 -> [[@LINE+6]]:2 = #0
+ if(i % 2) // CHECK-NEXT: File 0, [[@LINE]]:6 -> [[@LINE]]:11 = #0
throw Error(); // CHECK-NEXT: File 0, [[@LINE]]:5 -> [[@LINE]]:18 = #1
- else if(i == 8) // CHECK-NEXT: File 0, [[@LINE]]:8 -> [[@LINE+1]]:27 = (#0 - #1)
+ // CHECK-NEXT: File 0, [[@LINE+1]]:8 -> [[@LINE+2]]:27 = (#0 - #1)
+ else if(i == 8) // CHECK-NEXT: File 0, [[@LINE]]:11 -> [[@LINE]]:17 = (#0 - #1)
throw ImportantError(); // CHECK-NEXT: File 0, [[@LINE]]:5 -> [[@LINE]]:27 = #2
}