Debian Codegraph @

clang/test/AST/ast-dump-labeled-break-continue.c

raw
1 // Test without serialization:
2 // RUN: %clang_cc1 -std=c2y -ast-dump %s \
3 // RUN: | FileCheck -strict-whitespace %s
4 //
5 // Test with serialization:
6 // RUN: %clang_cc1 -std=c2y -emit-pch -o %t %s
7 // RUN: %clang_cc1 -x c -std=c2y -include-pch %t -ast-dump-all /dev/null \
8 // RUN: | sed -e "s/ <undeserialized declarations>//" -e "s/ imported//" \
9 // RUN: | FileCheck -strict-whitespace %s
10
11 void TestLabeledBreakContinue() {
12 a: while (true) {
13 break a;
14 continue a;
15 c: for (;;) {
16 break a;
17 continue a;
18 break c;
19 }
20 }
21 }
22
23 // CHECK-LABEL: `-FunctionDecl {{.*}} TestLabeledBreakContinue
24 // CHECK-NEXT: `-CompoundStmt {{.*}} <col:33, line:21:1>
25 // CHECK-NEXT: `-LabelStmt {{.*}} <line:12:3, line:20:3> 'a'
26 // CHECK-NEXT: `-WhileStmt {{.*}} <line:12:6, line:20:3>
27 // CHECK-NEXT: |-CXXBoolLiteralExpr {{.*}} <line:12:13> 'bool' true
28 // CHECK-NEXT: `-CompoundStmt {{.*}} <col:19, line:20:3>
29 // CHECK-NEXT: |-BreakStmt {{.*}} <line:13:5, col:11> 'a' (WhileStmt {{.*}})
30 // CHECK-NEXT: |-ContinueStmt {{.*}} <line:14:5, col:14> 'a' (WhileStmt {{.*}})
31 // CHECK-NEXT: `-LabelStmt {{.*}} <line:15:5, line:19:5> 'c'
32 // CHECK-NEXT: `-ForStmt {{.*}} <line:15:8, line:19:5>
33 // CHECK-NEXT: |-<<<NULL>>>
34 // CHECK-NEXT: |-<<<NULL>>>
35 // CHECK-NEXT: |-<<<NULL>>>
36 // CHECK-NEXT: |-<<<NULL>>>
37 // CHECK-NEXT: `-CompoundStmt {{.*}} <line:15:17, line:19:5>
38 // CHECK-NEXT: |-BreakStmt {{.*}} <line:16:7, col:13> 'a' (WhileStmt {{.*}})
39 // CHECK-NEXT: |-ContinueStmt {{.*}} <line:17:7, col:16> 'a' (WhileStmt {{.*}})
40 // CHECK-NEXT: `-BreakStmt {{.*}} <line:18:7, col:13> 'c' (ForStmt {{.*}})