xref: /minix3/external/bsd/llvm/dist/clang/test/CoverageMapping/continue.c (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -fprofile-instr-generate -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -main-file-name continue.c %s | FileCheck %s
2*0a6a1f1dSLionel Sambuc 
main()3*0a6a1f1dSLionel Sambuc int main() {                    // CHECK: File 0, [[@LINE]]:12 -> [[@LINE+21]]:2 = #0 (HasCodeBefore = 0)
4*0a6a1f1dSLionel Sambuc   int j = 0;                    // CHECK-NEXT: File 0, [[@LINE+2]]:18 -> [[@LINE+2]]:24 = (#0 + #1) (HasCodeBefore = 0)
5*0a6a1f1dSLionel Sambuc                                 // CHECK-NEXT: File 0, [[@LINE+1]]:26 -> [[@LINE+1]]:29 = #1 (HasCodeBefore = 0)
6*0a6a1f1dSLionel Sambuc   for(int i = 0; i < 20; ++i) { // CHECK-NEXT: File 0, [[@LINE]]:31 -> [[@LINE+17]]:4 = #1 (HasCodeBefore = 0)
7*0a6a1f1dSLionel Sambuc     if(i < 10) {                // CHECK-NEXT: File 0, [[@LINE]]:16 -> [[@LINE+13]]:6 = #2 (HasCodeBefore = 0)
8*0a6a1f1dSLionel Sambuc       if(i < 5) {               // CHECK-NEXT: File 0, [[@LINE]]:17 -> [[@LINE+3]]:8 = #3 (HasCodeBefore = 0)
9*0a6a1f1dSLionel Sambuc         continue;
10*0a6a1f1dSLionel Sambuc         j = 1;                   // CHECK-NEXT: File 0, [[@LINE]]:9 -> [[@LINE]]:14 = 0 (HasCodeBefore = 0)
11*0a6a1f1dSLionel Sambuc       } else {                   // CHECK-NEXT: File 0, [[@LINE]]:14 -> [[@LINE+7]]:13 = (#2 - #3) (HasCodeBefore = 0)
12*0a6a1f1dSLionel Sambuc         j = 2;
13*0a6a1f1dSLionel Sambuc       }
14*0a6a1f1dSLionel Sambuc       j = 3;
15*0a6a1f1dSLionel Sambuc       if(i < 7) {                // CHECK-NEXT: File 0, [[@LINE]]:17 -> [[@LINE+3]]:8 = #4 (HasCodeBefore = 0)
16*0a6a1f1dSLionel Sambuc         continue;
17*0a6a1f1dSLionel Sambuc         j = 4;                   // CHECK-NEXT: File 0, [[@LINE]]:9 -> [[@LINE]]:14 = 0 (HasCodeBefore = 0)
18*0a6a1f1dSLionel Sambuc       } else j = 5;              // CHECK-NEXT: File 0, [[@LINE]]:14 -> [[@LINE+1]]:12 = ((#2 - #3) - #4) (HasCodeBefore = 0)
19*0a6a1f1dSLionel Sambuc       j = 6;
20*0a6a1f1dSLionel Sambuc     } else                       // CHECK-NEXT: File 0, [[@LINE+1]]:7 -> [[@LINE+1]]:12 = (#1 - #2) (HasCodeBefore = 0)
21*0a6a1f1dSLionel Sambuc       j = 7;
22*0a6a1f1dSLionel Sambuc     j = 8;                       // CHECK-NEXT: File 0, [[@LINE]]:5 -> [[@LINE]]:10 = ((#1 - #3) - #4) (HasCodeBefore = 0)
23*0a6a1f1dSLionel Sambuc   }
24*0a6a1f1dSLionel Sambuc }
25