| // RUN: %clang_cc1 -triple x86_64-pc-linux -std=c++17 -ast-dump=json %s | FileCheck %s |
| |
| void func(int val) { |
| if (val) |
| ; |
| |
| if (val) |
| ; |
| else |
| ; |
| |
| if (val) |
| ; |
| else if (val) |
| ; |
| else |
| ; |
| |
| if constexpr(10 == 10) |
| ; |
| |
| if (int i = 12) |
| ; |
| |
| if (int i = 12; i) |
| ; |
| } |
| |
| // NOTE: CHECK lines have been autogenerated by gen_ast_dump_json_test.py |
| // using --filters=IfStmt |
| |
| |
| // CHECK: "kind": "IfStmt", |
| // CHECK-NEXT: "range": { |
| // CHECK-NEXT: "begin": { |
| // CHECK-NEXT: "offset": 111, |
| // CHECK-NEXT: "line": 4, |
| // CHECK-NEXT: "col": 3, |
| // CHECK-NEXT: "tokLen": 2 |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "end": { |
| // CHECK-NEXT: "offset": 124, |
| // CHECK-NEXT: "line": 5, |
| // CHECK-NEXT: "col": 5, |
| // CHECK-NEXT: "tokLen": 1 |
| // CHECK-NEXT: } |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "inner": [ |
| // CHECK-NEXT: { |
| // CHECK-NEXT: "id": "0x{{.*}}", |
| // CHECK-NEXT: "kind": "ImplicitCastExpr", |
| // CHECK-NEXT: "range": { |
| // CHECK-NEXT: "begin": { |
| // CHECK-NEXT: "offset": 115, |
| // CHECK-NEXT: "line": 4, |
| // CHECK-NEXT: "col": 7, |
| // CHECK-NEXT: "tokLen": 3 |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "end": { |
| // CHECK-NEXT: "offset": 115, |
| // CHECK-NEXT: "col": 7, |
| // CHECK-NEXT: "tokLen": 3 |
| // CHECK-NEXT: } |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "type": { |
| // CHECK-NEXT: "qualType": "bool" |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "valueCategory": "rvalue", |
| // CHECK-NEXT: "castKind": "IntegralToBoolean", |
| // CHECK-NEXT: "inner": [ |
| // CHECK-NEXT: { |
| // CHECK-NEXT: "id": "0x{{.*}}", |
| // CHECK-NEXT: "kind": "ImplicitCastExpr", |
| // CHECK-NEXT: "range": { |
| // CHECK-NEXT: "begin": { |
| // CHECK-NEXT: "offset": 115, |
| // CHECK-NEXT: "col": 7, |
| // CHECK-NEXT: "tokLen": 3 |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "end": { |
| // CHECK-NEXT: "offset": 115, |
| // CHECK-NEXT: "col": 7, |
| // CHECK-NEXT: "tokLen": 3 |
| // CHECK-NEXT: } |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "type": { |
| // CHECK-NEXT: "qualType": "int" |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "valueCategory": "rvalue", |
| // CHECK-NEXT: "castKind": "LValueToRValue", |
| // CHECK-NEXT: "inner": [ |
| // CHECK-NEXT: { |
| // CHECK-NEXT: "id": "0x{{.*}}", |
| // CHECK-NEXT: "kind": "DeclRefExpr", |
| // CHECK-NEXT: "range": { |
| // CHECK-NEXT: "begin": { |
| // CHECK-NEXT: "offset": 115, |
| // CHECK-NEXT: "col": 7, |
| // CHECK-NEXT: "tokLen": 3 |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "end": { |
| // CHECK-NEXT: "offset": 115, |
| // CHECK-NEXT: "col": 7, |
| // CHECK-NEXT: "tokLen": 3 |
| // CHECK-NEXT: } |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "type": { |
| // CHECK-NEXT: "qualType": "int" |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "valueCategory": "lvalue", |
| // CHECK-NEXT: "referencedDecl": { |
| // CHECK-NEXT: "id": "0x{{.*}}", |
| // CHECK-NEXT: "kind": "ParmVarDecl", |
| // CHECK-NEXT: "name": "val", |
| // CHECK-NEXT: "type": { |
| // CHECK-NEXT: "qualType": "int" |
| // CHECK-NEXT: } |
| // CHECK-NEXT: } |
| // CHECK-NEXT: } |
| // CHECK-NEXT: ] |
| // CHECK-NEXT: } |
| // CHECK-NEXT: ] |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: { |
| // CHECK-NEXT: "id": "0x{{.*}}", |
| // CHECK-NEXT: "kind": "NullStmt", |
| // CHECK-NEXT: "range": { |
| // CHECK-NEXT: "begin": { |
| // CHECK-NEXT: "offset": 124, |
| // CHECK-NEXT: "line": 5, |
| // CHECK-NEXT: "col": 5, |
| // CHECK-NEXT: "tokLen": 1 |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "end": { |
| // CHECK-NEXT: "offset": 124, |
| // CHECK-NEXT: "col": 5, |
| // CHECK-NEXT: "tokLen": 1 |
| // CHECK-NEXT: } |
| // CHECK-NEXT: } |
| // CHECK-NEXT: } |
| // CHECK-NEXT: ] |
| // CHECK-NEXT: } |
| |
| |
| // CHECK: "kind": "IfStmt", |
| // CHECK-NEXT: "range": { |
| // CHECK-NEXT: "begin": { |
| // CHECK-NEXT: "offset": 129, |
| // CHECK-NEXT: "line": 7, |
| // CHECK-NEXT: "col": 3, |
| // CHECK-NEXT: "tokLen": 2 |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "end": { |
| // CHECK-NEXT: "offset": 155, |
| // CHECK-NEXT: "line": 10, |
| // CHECK-NEXT: "col": 5, |
| // CHECK-NEXT: "tokLen": 1 |
| // CHECK-NEXT: } |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "hasElse": true, |
| // CHECK-NEXT: "inner": [ |
| // CHECK-NEXT: { |
| // CHECK-NEXT: "id": "0x{{.*}}", |
| // CHECK-NEXT: "kind": "ImplicitCastExpr", |
| // CHECK-NEXT: "range": { |
| // CHECK-NEXT: "begin": { |
| // CHECK-NEXT: "offset": 133, |
| // CHECK-NEXT: "line": 7, |
| // CHECK-NEXT: "col": 7, |
| // CHECK-NEXT: "tokLen": 3 |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "end": { |
| // CHECK-NEXT: "offset": 133, |
| // CHECK-NEXT: "col": 7, |
| // CHECK-NEXT: "tokLen": 3 |
| // CHECK-NEXT: } |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "type": { |
| // CHECK-NEXT: "qualType": "bool" |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "valueCategory": "rvalue", |
| // CHECK-NEXT: "castKind": "IntegralToBoolean", |
| // CHECK-NEXT: "inner": [ |
| // CHECK-NEXT: { |
| // CHECK-NEXT: "id": "0x{{.*}}", |
| // CHECK-NEXT: "kind": "ImplicitCastExpr", |
| // CHECK-NEXT: "range": { |
| // CHECK-NEXT: "begin": { |
| // CHECK-NEXT: "offset": 133, |
| // CHECK-NEXT: "col": 7, |
| // CHECK-NEXT: "tokLen": 3 |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "end": { |
| // CHECK-NEXT: "offset": 133, |
| // CHECK-NEXT: "col": 7, |
| // CHECK-NEXT: "tokLen": 3 |
| // CHECK-NEXT: } |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "type": { |
| // CHECK-NEXT: "qualType": "int" |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "valueCategory": "rvalue", |
| // CHECK-NEXT: "castKind": "LValueToRValue", |
| // CHECK-NEXT: "inner": [ |
| // CHECK-NEXT: { |
| // CHECK-NEXT: "id": "0x{{.*}}", |
| // CHECK-NEXT: "kind": "DeclRefExpr", |
| // CHECK-NEXT: "range": { |
| // CHECK-NEXT: "begin": { |
| // CHECK-NEXT: "offset": 133, |
| // CHECK-NEXT: "col": 7, |
| // CHECK-NEXT: "tokLen": 3 |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "end": { |
| // CHECK-NEXT: "offset": 133, |
| // CHECK-NEXT: "col": 7, |
| // CHECK-NEXT: "tokLen": 3 |
| // CHECK-NEXT: } |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "type": { |
| // CHECK-NEXT: "qualType": "int" |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "valueCategory": "lvalue", |
| // CHECK-NEXT: "referencedDecl": { |
| // CHECK-NEXT: "id": "0x{{.*}}", |
| // CHECK-NEXT: "kind": "ParmVarDecl", |
| // CHECK-NEXT: "name": "val", |
| // CHECK-NEXT: "type": { |
| // CHECK-NEXT: "qualType": "int" |
| // CHECK-NEXT: } |
| // CHECK-NEXT: } |
| // CHECK-NEXT: } |
| // CHECK-NEXT: ] |
| // CHECK-NEXT: } |
| // CHECK-NEXT: ] |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: { |
| // CHECK-NEXT: "id": "0x{{.*}}", |
| // CHECK-NEXT: "kind": "NullStmt", |
| // CHECK-NEXT: "range": { |
| // CHECK-NEXT: "begin": { |
| // CHECK-NEXT: "offset": 142, |
| // CHECK-NEXT: "line": 8, |
| // CHECK-NEXT: "col": 5, |
| // CHECK-NEXT: "tokLen": 1 |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "end": { |
| // CHECK-NEXT: "offset": 142, |
| // CHECK-NEXT: "col": 5, |
| // CHECK-NEXT: "tokLen": 1 |
| // CHECK-NEXT: } |
| // CHECK-NEXT: } |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: { |
| // CHECK-NEXT: "id": "0x{{.*}}", |
| // CHECK-NEXT: "kind": "NullStmt", |
| // CHECK-NEXT: "range": { |
| // CHECK-NEXT: "begin": { |
| // CHECK-NEXT: "offset": 155, |
| // CHECK-NEXT: "line": 10, |
| // CHECK-NEXT: "col": 5, |
| // CHECK-NEXT: "tokLen": 1 |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "end": { |
| // CHECK-NEXT: "offset": 155, |
| // CHECK-NEXT: "col": 5, |
| // CHECK-NEXT: "tokLen": 1 |
| // CHECK-NEXT: } |
| // CHECK-NEXT: } |
| // CHECK-NEXT: } |
| // CHECK-NEXT: ] |
| // CHECK-NEXT: } |
| |
| |
| // CHECK: "kind": "IfStmt", |
| // CHECK-NEXT: "range": { |
| // CHECK-NEXT: "begin": { |
| // CHECK-NEXT: "offset": 160, |
| // CHECK-NEXT: "line": 12, |
| // CHECK-NEXT: "col": 3, |
| // CHECK-NEXT: "tokLen": 2 |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "end": { |
| // CHECK-NEXT: "offset": 208, |
| // CHECK-NEXT: "line": 17, |
| // CHECK-NEXT: "col": 5, |
| // CHECK-NEXT: "tokLen": 1 |
| // CHECK-NEXT: } |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "hasElse": true, |
| // CHECK-NEXT: "inner": [ |
| // CHECK-NEXT: { |
| // CHECK-NEXT: "id": "0x{{.*}}", |
| // CHECK-NEXT: "kind": "ImplicitCastExpr", |
| // CHECK-NEXT: "range": { |
| // CHECK-NEXT: "begin": { |
| // CHECK-NEXT: "offset": 164, |
| // CHECK-NEXT: "line": 12, |
| // CHECK-NEXT: "col": 7, |
| // CHECK-NEXT: "tokLen": 3 |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "end": { |
| // CHECK-NEXT: "offset": 164, |
| // CHECK-NEXT: "col": 7, |
| // CHECK-NEXT: "tokLen": 3 |
| // CHECK-NEXT: } |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "type": { |
| // CHECK-NEXT: "qualType": "bool" |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "valueCategory": "rvalue", |
| // CHECK-NEXT: "castKind": "IntegralToBoolean", |
| // CHECK-NEXT: "inner": [ |
| // CHECK-NEXT: { |
| // CHECK-NEXT: "id": "0x{{.*}}", |
| // CHECK-NEXT: "kind": "ImplicitCastExpr", |
| // CHECK-NEXT: "range": { |
| // CHECK-NEXT: "begin": { |
| // CHECK-NEXT: "offset": 164, |
| // CHECK-NEXT: "col": 7, |
| // CHECK-NEXT: "tokLen": 3 |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "end": { |
| // CHECK-NEXT: "offset": 164, |
| // CHECK-NEXT: "col": 7, |
| // CHECK-NEXT: "tokLen": 3 |
| // CHECK-NEXT: } |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "type": { |
| // CHECK-NEXT: "qualType": "int" |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "valueCategory": "rvalue", |
| // CHECK-NEXT: "castKind": "LValueToRValue", |
| // CHECK-NEXT: "inner": [ |
| // CHECK-NEXT: { |
| // CHECK-NEXT: "id": "0x{{.*}}", |
| // CHECK-NEXT: "kind": "DeclRefExpr", |
| // CHECK-NEXT: "range": { |
| // CHECK-NEXT: "begin": { |
| // CHECK-NEXT: "offset": 164, |
| // CHECK-NEXT: "col": 7, |
| // CHECK-NEXT: "tokLen": 3 |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "end": { |
| // CHECK-NEXT: "offset": 164, |
| // CHECK-NEXT: "col": 7, |
| // CHECK-NEXT: "tokLen": 3 |
| // CHECK-NEXT: } |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "type": { |
| // CHECK-NEXT: "qualType": "int" |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "valueCategory": "lvalue", |
| // CHECK-NEXT: "referencedDecl": { |
| // CHECK-NEXT: "id": "0x{{.*}}", |
| // CHECK-NEXT: "kind": "ParmVarDecl", |
| // CHECK-NEXT: "name": "val", |
| // CHECK-NEXT: "type": { |
| // CHECK-NEXT: "qualType": "int" |
| // CHECK-NEXT: } |
| // CHECK-NEXT: } |
| // CHECK-NEXT: } |
| // CHECK-NEXT: ] |
| // CHECK-NEXT: } |
| // CHECK-NEXT: ] |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: { |
| // CHECK-NEXT: "id": "0x{{.*}}", |
| // CHECK-NEXT: "kind": "NullStmt", |
| // CHECK-NEXT: "range": { |
| // CHECK-NEXT: "begin": { |
| // CHECK-NEXT: "offset": 173, |
| // CHECK-NEXT: "line": 13, |
| // CHECK-NEXT: "col": 5, |
| // CHECK-NEXT: "tokLen": 1 |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "end": { |
| // CHECK-NEXT: "offset": 173, |
| // CHECK-NEXT: "col": 5, |
| // CHECK-NEXT: "tokLen": 1 |
| // CHECK-NEXT: } |
| // CHECK-NEXT: } |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: { |
| // CHECK-NEXT: "id": "0x{{.*}}", |
| // CHECK-NEXT: "kind": "IfStmt", |
| // CHECK-NEXT: "range": { |
| // CHECK-NEXT: "begin": { |
| // CHECK-NEXT: "offset": 182, |
| // CHECK-NEXT: "line": 14, |
| // CHECK-NEXT: "col": 8, |
| // CHECK-NEXT: "tokLen": 2 |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "end": { |
| // CHECK-NEXT: "offset": 208, |
| // CHECK-NEXT: "line": 17, |
| // CHECK-NEXT: "col": 5, |
| // CHECK-NEXT: "tokLen": 1 |
| // CHECK-NEXT: } |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "hasElse": true, |
| // CHECK-NEXT: "inner": [ |
| // CHECK-NEXT: { |
| // CHECK-NEXT: "id": "0x{{.*}}", |
| // CHECK-NEXT: "kind": "ImplicitCastExpr", |
| // CHECK-NEXT: "range": { |
| // CHECK-NEXT: "begin": { |
| // CHECK-NEXT: "offset": 186, |
| // CHECK-NEXT: "line": 14, |
| // CHECK-NEXT: "col": 12, |
| // CHECK-NEXT: "tokLen": 3 |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "end": { |
| // CHECK-NEXT: "offset": 186, |
| // CHECK-NEXT: "col": 12, |
| // CHECK-NEXT: "tokLen": 3 |
| // CHECK-NEXT: } |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "type": { |
| // CHECK-NEXT: "qualType": "bool" |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "valueCategory": "rvalue", |
| // CHECK-NEXT: "castKind": "IntegralToBoolean", |
| // CHECK-NEXT: "inner": [ |
| // CHECK-NEXT: { |
| // CHECK-NEXT: "id": "0x{{.*}}", |
| // CHECK-NEXT: "kind": "ImplicitCastExpr", |
| // CHECK-NEXT: "range": { |
| // CHECK-NEXT: "begin": { |
| // CHECK-NEXT: "offset": 186, |
| // CHECK-NEXT: "col": 12, |
| // CHECK-NEXT: "tokLen": 3 |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "end": { |
| // CHECK-NEXT: "offset": 186, |
| // CHECK-NEXT: "col": 12, |
| // CHECK-NEXT: "tokLen": 3 |
| // CHECK-NEXT: } |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "type": { |
| // CHECK-NEXT: "qualType": "int" |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "valueCategory": "rvalue", |
| // CHECK-NEXT: "castKind": "LValueToRValue", |
| // CHECK-NEXT: "inner": [ |
| // CHECK-NEXT: { |
| // CHECK-NEXT: "id": "0x{{.*}}", |
| // CHECK-NEXT: "kind": "DeclRefExpr", |
| // CHECK-NEXT: "range": { |
| // CHECK-NEXT: "begin": { |
| // CHECK-NEXT: "offset": 186, |
| // CHECK-NEXT: "col": 12, |
| // CHECK-NEXT: "tokLen": 3 |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "end": { |
| // CHECK-NEXT: "offset": 186, |
| // CHECK-NEXT: "col": 12, |
| // CHECK-NEXT: "tokLen": 3 |
| // CHECK-NEXT: } |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "type": { |
| // CHECK-NEXT: "qualType": "int" |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "valueCategory": "lvalue", |
| // CHECK-NEXT: "referencedDecl": { |
| // CHECK-NEXT: "id": "0x{{.*}}", |
| // CHECK-NEXT: "kind": "ParmVarDecl", |
| // CHECK-NEXT: "name": "val", |
| // CHECK-NEXT: "type": { |
| // CHECK-NEXT: "qualType": "int" |
| // CHECK-NEXT: } |
| // CHECK-NEXT: } |
| // CHECK-NEXT: } |
| // CHECK-NEXT: ] |
| // CHECK-NEXT: } |
| // CHECK-NEXT: ] |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: { |
| // CHECK-NEXT: "id": "0x{{.*}}", |
| // CHECK-NEXT: "kind": "NullStmt", |
| // CHECK-NEXT: "range": { |
| // CHECK-NEXT: "begin": { |
| // CHECK-NEXT: "offset": 195, |
| // CHECK-NEXT: "line": 15, |
| // CHECK-NEXT: "col": 5, |
| // CHECK-NEXT: "tokLen": 1 |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "end": { |
| // CHECK-NEXT: "offset": 195, |
| // CHECK-NEXT: "col": 5, |
| // CHECK-NEXT: "tokLen": 1 |
| // CHECK-NEXT: } |
| // CHECK-NEXT: } |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: { |
| // CHECK-NEXT: "id": "0x{{.*}}", |
| // CHECK-NEXT: "kind": "NullStmt", |
| // CHECK-NEXT: "range": { |
| // CHECK-NEXT: "begin": { |
| // CHECK-NEXT: "offset": 208, |
| // CHECK-NEXT: "line": 17, |
| // CHECK-NEXT: "col": 5, |
| // CHECK-NEXT: "tokLen": 1 |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "end": { |
| // CHECK-NEXT: "offset": 208, |
| // CHECK-NEXT: "col": 5, |
| // CHECK-NEXT: "tokLen": 1 |
| // CHECK-NEXT: } |
| // CHECK-NEXT: } |
| // CHECK-NEXT: } |
| // CHECK-NEXT: ] |
| // CHECK-NEXT: } |
| // CHECK-NEXT: ] |
| // CHECK-NEXT: } |
| |
| |
| // CHECK: "kind": "IfStmt", |
| // CHECK-NEXT: "range": { |
| // CHECK-NEXT: "begin": { |
| // CHECK-NEXT: "offset": 213, |
| // CHECK-NEXT: "line": 19, |
| // CHECK-NEXT: "col": 3, |
| // CHECK-NEXT: "tokLen": 2 |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "end": { |
| // CHECK-NEXT: "offset": 240, |
| // CHECK-NEXT: "line": 20, |
| // CHECK-NEXT: "col": 5, |
| // CHECK-NEXT: "tokLen": 1 |
| // CHECK-NEXT: } |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "isConstexpr": true, |
| // CHECK-NEXT: "inner": [ |
| // CHECK-NEXT: { |
| // CHECK-NEXT: "id": "0x{{.*}}", |
| // CHECK-NEXT: "kind": "ConstantExpr", |
| // CHECK-NEXT: "range": { |
| // CHECK-NEXT: "begin": { |
| // CHECK-NEXT: "offset": 226, |
| // CHECK-NEXT: "line": 19, |
| // CHECK-NEXT: "col": 16, |
| // CHECK-NEXT: "tokLen": 2 |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "end": { |
| // CHECK-NEXT: "offset": 232, |
| // CHECK-NEXT: "col": 22, |
| // CHECK-NEXT: "tokLen": 2 |
| // CHECK-NEXT: } |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "type": { |
| // CHECK-NEXT: "qualType": "bool" |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "valueCategory": "rvalue", |
| // CHECK-NEXT: "value": "true", |
| // CHECK-NEXT: "inner": [ |
| // CHECK-NEXT: { |
| // CHECK-NEXT: "id": "0x{{.*}}", |
| // CHECK-NEXT: "kind": "BinaryOperator", |
| // CHECK-NEXT: "range": { |
| // CHECK-NEXT: "begin": { |
| // CHECK-NEXT: "offset": 226, |
| // CHECK-NEXT: "col": 16, |
| // CHECK-NEXT: "tokLen": 2 |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "end": { |
| // CHECK-NEXT: "offset": 232, |
| // CHECK-NEXT: "col": 22, |
| // CHECK-NEXT: "tokLen": 2 |
| // CHECK-NEXT: } |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "type": { |
| // CHECK-NEXT: "qualType": "bool" |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "valueCategory": "rvalue", |
| // CHECK-NEXT: "opcode": "==", |
| // CHECK-NEXT: "inner": [ |
| // CHECK-NEXT: { |
| // CHECK-NEXT: "id": "0x{{.*}}", |
| // CHECK-NEXT: "kind": "IntegerLiteral", |
| // CHECK-NEXT: "range": { |
| // CHECK-NEXT: "begin": { |
| // CHECK-NEXT: "offset": 226, |
| // CHECK-NEXT: "col": 16, |
| // CHECK-NEXT: "tokLen": 2 |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "end": { |
| // CHECK-NEXT: "offset": 226, |
| // CHECK-NEXT: "col": 16, |
| // CHECK-NEXT: "tokLen": 2 |
| // CHECK-NEXT: } |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "type": { |
| // CHECK-NEXT: "qualType": "int" |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "valueCategory": "rvalue", |
| // CHECK-NEXT: "value": "10" |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: { |
| // CHECK-NEXT: "id": "0x{{.*}}", |
| // CHECK-NEXT: "kind": "IntegerLiteral", |
| // CHECK-NEXT: "range": { |
| // CHECK-NEXT: "begin": { |
| // CHECK-NEXT: "offset": 232, |
| // CHECK-NEXT: "col": 22, |
| // CHECK-NEXT: "tokLen": 2 |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "end": { |
| // CHECK-NEXT: "offset": 232, |
| // CHECK-NEXT: "col": 22, |
| // CHECK-NEXT: "tokLen": 2 |
| // CHECK-NEXT: } |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "type": { |
| // CHECK-NEXT: "qualType": "int" |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "valueCategory": "rvalue", |
| // CHECK-NEXT: "value": "10" |
| // CHECK-NEXT: } |
| // CHECK-NEXT: ] |
| // CHECK-NEXT: } |
| // CHECK-NEXT: ] |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: { |
| // CHECK-NEXT: "id": "0x{{.*}}", |
| // CHECK-NEXT: "kind": "NullStmt", |
| // CHECK-NEXT: "range": { |
| // CHECK-NEXT: "begin": { |
| // CHECK-NEXT: "offset": 240, |
| // CHECK-NEXT: "line": 20, |
| // CHECK-NEXT: "col": 5, |
| // CHECK-NEXT: "tokLen": 1 |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "end": { |
| // CHECK-NEXT: "offset": 240, |
| // CHECK-NEXT: "col": 5, |
| // CHECK-NEXT: "tokLen": 1 |
| // CHECK-NEXT: } |
| // CHECK-NEXT: } |
| // CHECK-NEXT: } |
| // CHECK-NEXT: ] |
| // CHECK-NEXT: } |
| |
| |
| // CHECK: "kind": "IfStmt", |
| // CHECK-NEXT: "range": { |
| // CHECK-NEXT: "begin": { |
| // CHECK-NEXT: "offset": 245, |
| // CHECK-NEXT: "line": 22, |
| // CHECK-NEXT: "col": 3, |
| // CHECK-NEXT: "tokLen": 2 |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "end": { |
| // CHECK-NEXT: "offset": 265, |
| // CHECK-NEXT: "line": 23, |
| // CHECK-NEXT: "col": 5, |
| // CHECK-NEXT: "tokLen": 1 |
| // CHECK-NEXT: } |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "hasVar": true, |
| // CHECK-NEXT: "inner": [ |
| // CHECK-NEXT: { |
| // CHECK-NEXT: "id": "0x{{.*}}", |
| // CHECK-NEXT: "kind": "DeclStmt", |
| // CHECK-NEXT: "range": { |
| // CHECK-NEXT: "begin": { |
| // CHECK-NEXT: "offset": 249, |
| // CHECK-NEXT: "line": 22, |
| // CHECK-NEXT: "col": 7, |
| // CHECK-NEXT: "tokLen": 3 |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "end": { |
| // CHECK-NEXT: "offset": 257, |
| // CHECK-NEXT: "col": 15, |
| // CHECK-NEXT: "tokLen": 2 |
| // CHECK-NEXT: } |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "inner": [ |
| // CHECK-NEXT: { |
| // CHECK-NEXT: "id": "0x{{.*}}", |
| // CHECK-NEXT: "kind": "VarDecl", |
| // CHECK-NEXT: "loc": { |
| // CHECK-NEXT: "offset": 253, |
| // CHECK-NEXT: "col": 11, |
| // CHECK-NEXT: "tokLen": 1 |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "range": { |
| // CHECK-NEXT: "begin": { |
| // CHECK-NEXT: "offset": 249, |
| // CHECK-NEXT: "col": 7, |
| // CHECK-NEXT: "tokLen": 3 |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "end": { |
| // CHECK-NEXT: "offset": 257, |
| // CHECK-NEXT: "col": 15, |
| // CHECK-NEXT: "tokLen": 2 |
| // CHECK-NEXT: } |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "isUsed": true, |
| // CHECK-NEXT: "name": "i", |
| // CHECK-NEXT: "type": { |
| // CHECK-NEXT: "qualType": "int" |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "init": "c", |
| // CHECK-NEXT: "inner": [ |
| // CHECK-NEXT: { |
| // CHECK-NEXT: "id": "0x{{.*}}", |
| // CHECK-NEXT: "kind": "IntegerLiteral", |
| // CHECK-NEXT: "range": { |
| // CHECK-NEXT: "begin": { |
| // CHECK-NEXT: "offset": 257, |
| // CHECK-NEXT: "col": 15, |
| // CHECK-NEXT: "tokLen": 2 |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "end": { |
| // CHECK-NEXT: "offset": 257, |
| // CHECK-NEXT: "col": 15, |
| // CHECK-NEXT: "tokLen": 2 |
| // CHECK-NEXT: } |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "type": { |
| // CHECK-NEXT: "qualType": "int" |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "valueCategory": "rvalue", |
| // CHECK-NEXT: "value": "12" |
| // CHECK-NEXT: } |
| // CHECK-NEXT: ] |
| // CHECK-NEXT: } |
| // CHECK-NEXT: ] |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: { |
| // CHECK-NEXT: "id": "0x{{.*}}", |
| // CHECK-NEXT: "kind": "ImplicitCastExpr", |
| // CHECK-NEXT: "range": { |
| // CHECK-NEXT: "begin": { |
| // CHECK-NEXT: "offset": 253, |
| // CHECK-NEXT: "col": 11, |
| // CHECK-NEXT: "tokLen": 1 |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "end": { |
| // CHECK-NEXT: "offset": 253, |
| // CHECK-NEXT: "col": 11, |
| // CHECK-NEXT: "tokLen": 1 |
| // CHECK-NEXT: } |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "type": { |
| // CHECK-NEXT: "qualType": "bool" |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "valueCategory": "rvalue", |
| // CHECK-NEXT: "castKind": "IntegralToBoolean", |
| // CHECK-NEXT: "inner": [ |
| // CHECK-NEXT: { |
| // CHECK-NEXT: "id": "0x{{.*}}", |
| // CHECK-NEXT: "kind": "ImplicitCastExpr", |
| // CHECK-NEXT: "range": { |
| // CHECK-NEXT: "begin": { |
| // CHECK-NEXT: "offset": 253, |
| // CHECK-NEXT: "col": 11, |
| // CHECK-NEXT: "tokLen": 1 |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "end": { |
| // CHECK-NEXT: "offset": 253, |
| // CHECK-NEXT: "col": 11, |
| // CHECK-NEXT: "tokLen": 1 |
| // CHECK-NEXT: } |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "type": { |
| // CHECK-NEXT: "qualType": "int" |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "valueCategory": "rvalue", |
| // CHECK-NEXT: "castKind": "LValueToRValue", |
| // CHECK-NEXT: "inner": [ |
| // CHECK-NEXT: { |
| // CHECK-NEXT: "id": "0x{{.*}}", |
| // CHECK-NEXT: "kind": "DeclRefExpr", |
| // CHECK-NEXT: "range": { |
| // CHECK-NEXT: "begin": { |
| // CHECK-NEXT: "offset": 253, |
| // CHECK-NEXT: "col": 11, |
| // CHECK-NEXT: "tokLen": 1 |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "end": { |
| // CHECK-NEXT: "offset": 253, |
| // CHECK-NEXT: "col": 11, |
| // CHECK-NEXT: "tokLen": 1 |
| // CHECK-NEXT: } |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "type": { |
| // CHECK-NEXT: "qualType": "int" |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "valueCategory": "lvalue", |
| // CHECK-NEXT: "referencedDecl": { |
| // CHECK-NEXT: "id": "0x{{.*}}", |
| // CHECK-NEXT: "kind": "VarDecl", |
| // CHECK-NEXT: "name": "i", |
| // CHECK-NEXT: "type": { |
| // CHECK-NEXT: "qualType": "int" |
| // CHECK-NEXT: } |
| // CHECK-NEXT: } |
| // CHECK-NEXT: } |
| // CHECK-NEXT: ] |
| // CHECK-NEXT: } |
| // CHECK-NEXT: ] |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: { |
| // CHECK-NEXT: "id": "0x{{.*}}", |
| // CHECK-NEXT: "kind": "NullStmt", |
| // CHECK-NEXT: "range": { |
| // CHECK-NEXT: "begin": { |
| // CHECK-NEXT: "offset": 265, |
| // CHECK-NEXT: "line": 23, |
| // CHECK-NEXT: "col": 5, |
| // CHECK-NEXT: "tokLen": 1 |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "end": { |
| // CHECK-NEXT: "offset": 265, |
| // CHECK-NEXT: "col": 5, |
| // CHECK-NEXT: "tokLen": 1 |
| // CHECK-NEXT: } |
| // CHECK-NEXT: } |
| // CHECK-NEXT: } |
| // CHECK-NEXT: ] |
| // CHECK-NEXT: } |
| |
| |
| // CHECK: "kind": "IfStmt", |
| // CHECK-NEXT: "range": { |
| // CHECK-NEXT: "begin": { |
| // CHECK-NEXT: "offset": 270, |
| // CHECK-NEXT: "line": 25, |
| // CHECK-NEXT: "col": 3, |
| // CHECK-NEXT: "tokLen": 2 |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "end": { |
| // CHECK-NEXT: "offset": 293, |
| // CHECK-NEXT: "line": 26, |
| // CHECK-NEXT: "col": 5, |
| // CHECK-NEXT: "tokLen": 1 |
| // CHECK-NEXT: } |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "hasInit": true, |
| // CHECK-NEXT: "inner": [ |
| // CHECK-NEXT: { |
| // CHECK-NEXT: "id": "0x{{.*}}", |
| // CHECK-NEXT: "kind": "DeclStmt", |
| // CHECK-NEXT: "range": { |
| // CHECK-NEXT: "begin": { |
| // CHECK-NEXT: "offset": 274, |
| // CHECK-NEXT: "line": 25, |
| // CHECK-NEXT: "col": 7, |
| // CHECK-NEXT: "tokLen": 3 |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "end": { |
| // CHECK-NEXT: "offset": 284, |
| // CHECK-NEXT: "col": 17, |
| // CHECK-NEXT: "tokLen": 1 |
| // CHECK-NEXT: } |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "inner": [ |
| // CHECK-NEXT: { |
| // CHECK-NEXT: "id": "0x{{.*}}", |
| // CHECK-NEXT: "kind": "VarDecl", |
| // CHECK-NEXT: "loc": { |
| // CHECK-NEXT: "offset": 278, |
| // CHECK-NEXT: "col": 11, |
| // CHECK-NEXT: "tokLen": 1 |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "range": { |
| // CHECK-NEXT: "begin": { |
| // CHECK-NEXT: "offset": 274, |
| // CHECK-NEXT: "col": 7, |
| // CHECK-NEXT: "tokLen": 3 |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "end": { |
| // CHECK-NEXT: "offset": 282, |
| // CHECK-NEXT: "col": 15, |
| // CHECK-NEXT: "tokLen": 2 |
| // CHECK-NEXT: } |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "isUsed": true, |
| // CHECK-NEXT: "name": "i", |
| // CHECK-NEXT: "type": { |
| // CHECK-NEXT: "qualType": "int" |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "init": "c", |
| // CHECK-NEXT: "inner": [ |
| // CHECK-NEXT: { |
| // CHECK-NEXT: "id": "0x{{.*}}", |
| // CHECK-NEXT: "kind": "IntegerLiteral", |
| // CHECK-NEXT: "range": { |
| // CHECK-NEXT: "begin": { |
| // CHECK-NEXT: "offset": 282, |
| // CHECK-NEXT: "col": 15, |
| // CHECK-NEXT: "tokLen": 2 |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "end": { |
| // CHECK-NEXT: "offset": 282, |
| // CHECK-NEXT: "col": 15, |
| // CHECK-NEXT: "tokLen": 2 |
| // CHECK-NEXT: } |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "type": { |
| // CHECK-NEXT: "qualType": "int" |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "valueCategory": "rvalue", |
| // CHECK-NEXT: "value": "12" |
| // CHECK-NEXT: } |
| // CHECK-NEXT: ] |
| // CHECK-NEXT: } |
| // CHECK-NEXT: ] |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: { |
| // CHECK-NEXT: "id": "0x{{.*}}", |
| // CHECK-NEXT: "kind": "ImplicitCastExpr", |
| // CHECK-NEXT: "range": { |
| // CHECK-NEXT: "begin": { |
| // CHECK-NEXT: "offset": 286, |
| // CHECK-NEXT: "col": 19, |
| // CHECK-NEXT: "tokLen": 1 |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "end": { |
| // CHECK-NEXT: "offset": 286, |
| // CHECK-NEXT: "col": 19, |
| // CHECK-NEXT: "tokLen": 1 |
| // CHECK-NEXT: } |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "type": { |
| // CHECK-NEXT: "qualType": "bool" |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "valueCategory": "rvalue", |
| // CHECK-NEXT: "castKind": "IntegralToBoolean", |
| // CHECK-NEXT: "inner": [ |
| // CHECK-NEXT: { |
| // CHECK-NEXT: "id": "0x{{.*}}", |
| // CHECK-NEXT: "kind": "ImplicitCastExpr", |
| // CHECK-NEXT: "range": { |
| // CHECK-NEXT: "begin": { |
| // CHECK-NEXT: "offset": 286, |
| // CHECK-NEXT: "col": 19, |
| // CHECK-NEXT: "tokLen": 1 |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "end": { |
| // CHECK-NEXT: "offset": 286, |
| // CHECK-NEXT: "col": 19, |
| // CHECK-NEXT: "tokLen": 1 |
| // CHECK-NEXT: } |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "type": { |
| // CHECK-NEXT: "qualType": "int" |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "valueCategory": "rvalue", |
| // CHECK-NEXT: "castKind": "LValueToRValue", |
| // CHECK-NEXT: "inner": [ |
| // CHECK-NEXT: { |
| // CHECK-NEXT: "id": "0x{{.*}}", |
| // CHECK-NEXT: "kind": "DeclRefExpr", |
| // CHECK-NEXT: "range": { |
| // CHECK-NEXT: "begin": { |
| // CHECK-NEXT: "offset": 286, |
| // CHECK-NEXT: "col": 19, |
| // CHECK-NEXT: "tokLen": 1 |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "end": { |
| // CHECK-NEXT: "offset": 286, |
| // CHECK-NEXT: "col": 19, |
| // CHECK-NEXT: "tokLen": 1 |
| // CHECK-NEXT: } |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "type": { |
| // CHECK-NEXT: "qualType": "int" |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "valueCategory": "lvalue", |
| // CHECK-NEXT: "referencedDecl": { |
| // CHECK-NEXT: "id": "0x{{.*}}", |
| // CHECK-NEXT: "kind": "VarDecl", |
| // CHECK-NEXT: "name": "i", |
| // CHECK-NEXT: "type": { |
| // CHECK-NEXT: "qualType": "int" |
| // CHECK-NEXT: } |
| // CHECK-NEXT: } |
| // CHECK-NEXT: } |
| // CHECK-NEXT: ] |
| // CHECK-NEXT: } |
| // CHECK-NEXT: ] |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: { |
| // CHECK-NEXT: "id": "0x{{.*}}", |
| // CHECK-NEXT: "kind": "NullStmt", |
| // CHECK-NEXT: "range": { |
| // CHECK-NEXT: "begin": { |
| // CHECK-NEXT: "offset": 293, |
| // CHECK-NEXT: "line": 26, |
| // CHECK-NEXT: "col": 5, |
| // CHECK-NEXT: "tokLen": 1 |
| // CHECK-NEXT: }, |
| // CHECK-NEXT: "end": { |
| // CHECK-NEXT: "offset": 293, |
| // CHECK-NEXT: "col": 5, |
| // CHECK-NEXT: "tokLen": 1 |
| // CHECK-NEXT: } |
| // CHECK-NEXT: } |
| // CHECK-NEXT: } |
| // CHECK-NEXT: ] |
| // CHECK-NEXT: } |