vsk planned changes to this revision.
vsk marked an inline comment as done.
vsk added a comment.

I'll write something up in the coverage mapping docs. Briefly, though, with 
this change there should be a gap region that covers the entire switch body 
(starting from the '{' in 'switch {', and terminating where the last case ends).



================
Comment at: clang/test/CoverageMapping/switch.cpp:32
   switch (i) {      // CHECK-NEXT: File 0, [[@LINE]]:3 -> [[@LINE+6]]:2 = #4
-    nop();          // CHECK-NEXT: File 0, [[@LINE]]:5 -> [[@LINE+2]]:10 = 0
+    nop();          // CHECK-NEXT: Gap,File 0, [[@LINE-1]]:14 -> 
[[@LINE+2]]:10 = 0
   case 1:           // CHECK-NEXT: File 0, [[@LINE]]:3 -> [[@LINE+1]]:10 = #7
----------------
efriedma wrote:
> I'm not sure I understand the effect here.  Will we show that nop() never 
> executes, or will we not show any coverage information for it?
The report will show an execution count of 0 for that call to nop(). In general 
a gap region's count is selected as the line count when it's the only region 
present in a line.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70571/new/

https://reviews.llvm.org/D70571



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to