2019-09-05 04:30:00 +08:00
|
|
|
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -ast-dump=json -ast-dump-filter Test %s | FileCheck %s
|
|
|
|
|
|
|
|
namespace Test {
|
|
|
|
|
|
|
|
namespace NS {
|
|
|
|
void Function();
|
|
|
|
}
|
|
|
|
void NS::Function() {}
|
|
|
|
|
|
|
|
struct S {
|
|
|
|
void Method();
|
|
|
|
};
|
|
|
|
void S::Method() {}
|
|
|
|
|
|
|
|
} // namespace Test
|
|
|
|
|
2019-10-16 01:30:19 +08:00
|
|
|
// NOTE: CHECK lines have been autogenerated by gen_ast_dump_json_test.py
|
|
|
|
|
2021-10-10 08:44:08 +08:00
|
|
|
// CHECK-NOT: {{^}}Dumping
|
2019-09-05 04:30:00 +08:00
|
|
|
// CHECK: "kind": "NamespaceDecl",
|
|
|
|
// CHECK-NEXT: "loc": {
|
2022-01-20 07:55:20 +08:00
|
|
|
// CHECK-NEXT: "offset": {{[0-9]+}},
|
2019-09-05 04:30:00 +08:00
|
|
|
// CHECK-NEXT: "file": "{{.*}}",
|
|
|
|
// CHECK-NEXT: "line": 3,
|
|
|
|
// CHECK-NEXT: "col": 11,
|
|
|
|
// CHECK-NEXT: "tokLen": 4
|
|
|
|
// CHECK-NEXT: },
|
|
|
|
// CHECK-NEXT: "range": {
|
|
|
|
// CHECK-NEXT: "begin": {
|
2022-01-20 07:55:20 +08:00
|
|
|
// CHECK-NEXT: "offset": {{[0-9]+}},
|
2019-09-05 04:30:00 +08:00
|
|
|
// CHECK-NEXT: "col": 1,
|
|
|
|
// CHECK-NEXT: "tokLen": 9
|
|
|
|
// CHECK-NEXT: },
|
|
|
|
// CHECK-NEXT: "end": {
|
2022-01-20 07:55:20 +08:00
|
|
|
// CHECK-NEXT: "offset": {{[0-9]+}},
|
2019-09-05 04:30:00 +08:00
|
|
|
// CHECK-NEXT: "line": 15,
|
|
|
|
// CHECK-NEXT: "col": 1,
|
|
|
|
// CHECK-NEXT: "tokLen": 1
|
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: },
|
|
|
|
// CHECK-NEXT: "name": "Test",
|
|
|
|
// CHECK-NEXT: "inner": [
|
|
|
|
// CHECK-NEXT: {
|
2019-10-16 01:30:19 +08:00
|
|
|
// CHECK-NEXT: "id": "0x{{.*}}",
|
2019-09-05 04:30:00 +08:00
|
|
|
// CHECK-NEXT: "kind": "NamespaceDecl",
|
|
|
|
// CHECK-NEXT: "loc": {
|
2022-01-20 07:55:20 +08:00
|
|
|
// CHECK-NEXT: "offset": {{[0-9]+}},
|
2019-09-05 04:30:00 +08:00
|
|
|
// CHECK-NEXT: "line": 5,
|
|
|
|
// CHECK-NEXT: "col": 11,
|
|
|
|
// CHECK-NEXT: "tokLen": 2
|
|
|
|
// CHECK-NEXT: },
|
|
|
|
// CHECK-NEXT: "range": {
|
|
|
|
// CHECK-NEXT: "begin": {
|
2022-01-20 07:55:20 +08:00
|
|
|
// CHECK-NEXT: "offset": {{[0-9]+}},
|
2019-09-05 04:30:00 +08:00
|
|
|
// CHECK-NEXT: "col": 1,
|
|
|
|
// CHECK-NEXT: "tokLen": 9
|
|
|
|
// CHECK-NEXT: },
|
|
|
|
// CHECK-NEXT: "end": {
|
2022-01-20 07:55:20 +08:00
|
|
|
// CHECK-NEXT: "offset": {{[0-9]+}},
|
2019-09-05 04:30:00 +08:00
|
|
|
// CHECK-NEXT: "line": 7,
|
|
|
|
// CHECK-NEXT: "col": 1,
|
|
|
|
// CHECK-NEXT: "tokLen": 1
|
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: },
|
|
|
|
// CHECK-NEXT: "name": "NS",
|
|
|
|
// CHECK-NEXT: "inner": [
|
|
|
|
// CHECK-NEXT: {
|
2019-10-16 01:30:19 +08:00
|
|
|
// CHECK-NEXT: "id": "0x{{.*}}",
|
2019-09-05 04:30:00 +08:00
|
|
|
// CHECK-NEXT: "kind": "FunctionDecl",
|
|
|
|
// CHECK-NEXT: "loc": {
|
2022-01-20 07:55:20 +08:00
|
|
|
// CHECK-NEXT: "offset": {{[0-9]+}},
|
2019-09-05 04:30:00 +08:00
|
|
|
// CHECK-NEXT: "line": 6,
|
|
|
|
// CHECK-NEXT: "col": 6,
|
|
|
|
// CHECK-NEXT: "tokLen": 8
|
|
|
|
// CHECK-NEXT: },
|
|
|
|
// CHECK-NEXT: "range": {
|
|
|
|
// CHECK-NEXT: "begin": {
|
2022-01-20 07:55:20 +08:00
|
|
|
// CHECK-NEXT: "offset": {{[0-9]+}},
|
2019-09-05 04:30:00 +08:00
|
|
|
// CHECK-NEXT: "col": 1,
|
|
|
|
// CHECK-NEXT: "tokLen": 4
|
|
|
|
// CHECK-NEXT: },
|
|
|
|
// CHECK-NEXT: "end": {
|
2022-01-20 07:55:20 +08:00
|
|
|
// CHECK-NEXT: "offset": {{[0-9]+}},
|
2019-09-05 04:30:00 +08:00
|
|
|
// CHECK-NEXT: "col": 15,
|
|
|
|
// CHECK-NEXT: "tokLen": 1
|
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: },
|
|
|
|
// CHECK-NEXT: "name": "Function",
|
2019-11-15 20:33:16 +08:00
|
|
|
// CHECK-NEXT: "mangledName": "_ZN4Test2NS8FunctionEv",
|
2019-09-05 04:30:00 +08:00
|
|
|
// CHECK-NEXT: "type": {
|
|
|
|
// CHECK-NEXT: "qualType": "void ()"
|
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: ]
|
|
|
|
// CHECK-NEXT: },
|
|
|
|
// CHECK-NEXT: {
|
|
|
|
// CHECK-NEXT: "id": "0x{{.*}}",
|
|
|
|
// CHECK-NEXT: "kind": "FunctionDecl",
|
|
|
|
// CHECK-NEXT: "loc": {
|
2022-01-20 07:55:20 +08:00
|
|
|
// CHECK-NEXT: "offset": {{[0-9]+}},
|
2019-09-05 04:30:00 +08:00
|
|
|
// CHECK-NEXT: "line": 8,
|
|
|
|
// CHECK-NEXT: "col": 10,
|
|
|
|
// CHECK-NEXT: "tokLen": 8
|
|
|
|
// CHECK-NEXT: },
|
|
|
|
// CHECK-NEXT: "range": {
|
|
|
|
// CHECK-NEXT: "begin": {
|
2022-01-20 07:55:20 +08:00
|
|
|
// CHECK-NEXT: "offset": {{[0-9]+}},
|
2019-09-05 04:30:00 +08:00
|
|
|
// CHECK-NEXT: "col": 1,
|
|
|
|
// CHECK-NEXT: "tokLen": 4
|
|
|
|
// CHECK-NEXT: },
|
|
|
|
// CHECK-NEXT: "end": {
|
2022-01-20 07:55:20 +08:00
|
|
|
// CHECK-NEXT: "offset": {{[0-9]+}},
|
2019-09-05 04:30:00 +08:00
|
|
|
// CHECK-NEXT: "col": 22,
|
|
|
|
// CHECK-NEXT: "tokLen": 1
|
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: },
|
2019-10-16 01:30:19 +08:00
|
|
|
// CHECK-NEXT: "parentDeclContextId": "0x{{.*}}",
|
|
|
|
// CHECK-NEXT: "previousDecl": "0x{{.*}}",
|
2019-09-05 04:30:00 +08:00
|
|
|
// CHECK-NEXT: "name": "Function",
|
2019-11-15 20:33:16 +08:00
|
|
|
// CHECK-NEXT: "mangledName": "_ZN4Test2NS8FunctionEv",
|
2019-09-05 04:30:00 +08:00
|
|
|
// CHECK-NEXT: "type": {
|
|
|
|
// CHECK-NEXT: "qualType": "void ()"
|
|
|
|
// CHECK-NEXT: },
|
|
|
|
// CHECK-NEXT: "inner": [
|
|
|
|
// CHECK-NEXT: {
|
|
|
|
// CHECK-NEXT: "id": "0x{{.*}}",
|
|
|
|
// CHECK-NEXT: "kind": "CompoundStmt",
|
|
|
|
// CHECK-NEXT: "range": {
|
|
|
|
// CHECK-NEXT: "begin": {
|
2022-01-20 07:55:20 +08:00
|
|
|
// CHECK-NEXT: "offset": {{[0-9]+}},
|
2019-09-05 04:30:00 +08:00
|
|
|
// CHECK-NEXT: "col": 21,
|
|
|
|
// CHECK-NEXT: "tokLen": 1
|
|
|
|
// CHECK-NEXT: },
|
|
|
|
// CHECK-NEXT: "end": {
|
2022-01-20 07:55:20 +08:00
|
|
|
// CHECK-NEXT: "offset": {{[0-9]+}},
|
2019-09-05 04:30:00 +08:00
|
|
|
// CHECK-NEXT: "col": 22,
|
|
|
|
// CHECK-NEXT: "tokLen": 1
|
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: ]
|
|
|
|
// CHECK-NEXT: },
|
|
|
|
// CHECK-NEXT: {
|
2019-10-16 01:30:19 +08:00
|
|
|
// CHECK-NEXT: "id": "0x{{.*}}",
|
2019-09-05 04:30:00 +08:00
|
|
|
// CHECK-NEXT: "kind": "CXXRecordDecl",
|
|
|
|
// CHECK-NEXT: "loc": {
|
2022-01-20 07:55:20 +08:00
|
|
|
// CHECK-NEXT: "offset": {{[0-9]+}},
|
2019-09-05 04:30:00 +08:00
|
|
|
// CHECK-NEXT: "line": 10,
|
|
|
|
// CHECK-NEXT: "col": 8,
|
|
|
|
// CHECK-NEXT: "tokLen": 1
|
|
|
|
// CHECK-NEXT: },
|
|
|
|
// CHECK-NEXT: "range": {
|
|
|
|
// CHECK-NEXT: "begin": {
|
2022-01-20 07:55:20 +08:00
|
|
|
// CHECK-NEXT: "offset": {{[0-9]+}},
|
2019-09-05 04:30:00 +08:00
|
|
|
// CHECK-NEXT: "col": 1,
|
|
|
|
// CHECK-NEXT: "tokLen": 6
|
|
|
|
// CHECK-NEXT: },
|
|
|
|
// CHECK-NEXT: "end": {
|
2022-01-20 07:55:20 +08:00
|
|
|
// CHECK-NEXT: "offset": {{[0-9]+}},
|
2019-09-05 04:30:00 +08:00
|
|
|
// CHECK-NEXT: "line": 12,
|
|
|
|
// CHECK-NEXT: "col": 1,
|
|
|
|
// CHECK-NEXT: "tokLen": 1
|
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: },
|
|
|
|
// CHECK-NEXT: "name": "S",
|
|
|
|
// CHECK-NEXT: "tagUsed": "struct",
|
|
|
|
// CHECK-NEXT: "completeDefinition": true,
|
|
|
|
// CHECK-NEXT: "definitionData": {
|
|
|
|
// CHECK-NEXT: "canConstDefaultInit": true,
|
|
|
|
// CHECK-NEXT: "canPassInRegisters": true,
|
|
|
|
// CHECK-NEXT: "copyAssign": {
|
|
|
|
// CHECK-NEXT: "hasConstParam": true,
|
|
|
|
// CHECK-NEXT: "implicitHasConstParam": true,
|
|
|
|
// CHECK-NEXT: "needsImplicit": true,
|
2020-06-05 10:16:05 +08:00
|
|
|
// CHECK-NEXT: "simple": true,
|
2019-09-05 04:30:00 +08:00
|
|
|
// CHECK-NEXT: "trivial": true
|
|
|
|
// CHECK-NEXT: },
|
|
|
|
// CHECK-NEXT: "copyCtor": {
|
|
|
|
// CHECK-NEXT: "hasConstParam": true,
|
|
|
|
// CHECK-NEXT: "implicitHasConstParam": true,
|
|
|
|
// CHECK-NEXT: "needsImplicit": true,
|
|
|
|
// CHECK-NEXT: "simple": true,
|
|
|
|
// CHECK-NEXT: "trivial": true
|
|
|
|
// CHECK-NEXT: },
|
|
|
|
// CHECK-NEXT: "defaultCtor": {
|
|
|
|
// CHECK-NEXT: "defaultedIsConstexpr": true,
|
|
|
|
// CHECK-NEXT: "exists": true,
|
|
|
|
// CHECK-NEXT: "isConstexpr": true,
|
|
|
|
// CHECK-NEXT: "needsImplicit": true,
|
|
|
|
// CHECK-NEXT: "trivial": true
|
|
|
|
// CHECK-NEXT: },
|
|
|
|
// CHECK-NEXT: "dtor": {
|
|
|
|
// CHECK-NEXT: "irrelevant": true,
|
|
|
|
// CHECK-NEXT: "needsImplicit": true,
|
|
|
|
// CHECK-NEXT: "simple": true,
|
|
|
|
// CHECK-NEXT: "trivial": true
|
|
|
|
// CHECK-NEXT: },
|
|
|
|
// CHECK-NEXT: "hasConstexprNonCopyMoveConstructor": true,
|
|
|
|
// CHECK-NEXT: "isAggregate": true,
|
|
|
|
// CHECK-NEXT: "isEmpty": true,
|
|
|
|
// CHECK-NEXT: "isLiteral": true,
|
|
|
|
// CHECK-NEXT: "isPOD": true,
|
|
|
|
// CHECK-NEXT: "isStandardLayout": true,
|
|
|
|
// CHECK-NEXT: "isTrivial": true,
|
|
|
|
// CHECK-NEXT: "isTriviallyCopyable": true,
|
|
|
|
// CHECK-NEXT: "moveAssign": {
|
|
|
|
// CHECK-NEXT: "exists": true,
|
|
|
|
// CHECK-NEXT: "needsImplicit": true,
|
|
|
|
// CHECK-NEXT: "simple": true,
|
|
|
|
// CHECK-NEXT: "trivial": true
|
|
|
|
// CHECK-NEXT: },
|
|
|
|
// CHECK-NEXT: "moveCtor": {
|
|
|
|
// CHECK-NEXT: "exists": true,
|
|
|
|
// CHECK-NEXT: "needsImplicit": true,
|
|
|
|
// CHECK-NEXT: "simple": true,
|
|
|
|
// CHECK-NEXT: "trivial": true
|
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: },
|
|
|
|
// CHECK-NEXT: "inner": [
|
|
|
|
// CHECK-NEXT: {
|
|
|
|
// CHECK-NEXT: "id": "0x{{.*}}",
|
|
|
|
// CHECK-NEXT: "kind": "CXXRecordDecl",
|
|
|
|
// CHECK-NEXT: "loc": {
|
2022-01-20 07:55:20 +08:00
|
|
|
// CHECK-NEXT: "offset": {{[0-9]+}},
|
2019-09-05 04:30:00 +08:00
|
|
|
// CHECK-NEXT: "line": 10,
|
|
|
|
// CHECK-NEXT: "col": 8,
|
|
|
|
// CHECK-NEXT: "tokLen": 1
|
|
|
|
// CHECK-NEXT: },
|
|
|
|
// CHECK-NEXT: "range": {
|
|
|
|
// CHECK-NEXT: "begin": {
|
2022-01-20 07:55:20 +08:00
|
|
|
// CHECK-NEXT: "offset": {{[0-9]+}},
|
2019-09-05 04:30:00 +08:00
|
|
|
// CHECK-NEXT: "col": 1,
|
|
|
|
// CHECK-NEXT: "tokLen": 6
|
|
|
|
// CHECK-NEXT: },
|
|
|
|
// CHECK-NEXT: "end": {
|
2022-01-20 07:55:20 +08:00
|
|
|
// CHECK-NEXT: "offset": {{[0-9]+}},
|
2019-09-05 04:30:00 +08:00
|
|
|
// CHECK-NEXT: "col": 8,
|
|
|
|
// CHECK-NEXT: "tokLen": 1
|
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: },
|
|
|
|
// CHECK-NEXT: "isImplicit": true,
|
|
|
|
// CHECK-NEXT: "name": "S",
|
|
|
|
// CHECK-NEXT: "tagUsed": "struct"
|
|
|
|
// CHECK-NEXT: },
|
|
|
|
// CHECK-NEXT: {
|
2019-10-16 01:30:19 +08:00
|
|
|
// CHECK-NEXT: "id": "0x{{.*}}",
|
2019-09-05 04:30:00 +08:00
|
|
|
// CHECK-NEXT: "kind": "CXXMethodDecl",
|
|
|
|
// CHECK-NEXT: "loc": {
|
2022-01-20 07:55:20 +08:00
|
|
|
// CHECK-NEXT: "offset": {{[0-9]+}},
|
2019-09-05 04:30:00 +08:00
|
|
|
// CHECK-NEXT: "line": 11,
|
|
|
|
// CHECK-NEXT: "col": 8,
|
|
|
|
// CHECK-NEXT: "tokLen": 6
|
|
|
|
// CHECK-NEXT: },
|
|
|
|
// CHECK-NEXT: "range": {
|
|
|
|
// CHECK-NEXT: "begin": {
|
2022-01-20 07:55:20 +08:00
|
|
|
// CHECK-NEXT: "offset": {{[0-9]+}},
|
2019-09-05 04:30:00 +08:00
|
|
|
// CHECK-NEXT: "col": 3,
|
|
|
|
// CHECK-NEXT: "tokLen": 4
|
|
|
|
// CHECK-NEXT: },
|
|
|
|
// CHECK-NEXT: "end": {
|
2022-01-20 07:55:20 +08:00
|
|
|
// CHECK-NEXT: "offset": {{[0-9]+}},
|
2019-09-05 04:30:00 +08:00
|
|
|
// CHECK-NEXT: "col": 15,
|
|
|
|
// CHECK-NEXT: "tokLen": 1
|
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: },
|
|
|
|
// CHECK-NEXT: "name": "Method",
|
2019-11-15 20:33:16 +08:00
|
|
|
// CHECK-NEXT: "mangledName": "_ZN4Test1S6MethodEv",
|
2019-09-05 04:30:00 +08:00
|
|
|
// CHECK-NEXT: "type": {
|
|
|
|
// CHECK-NEXT: "qualType": "void ()"
|
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: ]
|
|
|
|
// CHECK-NEXT: },
|
|
|
|
// CHECK-NEXT: {
|
|
|
|
// CHECK-NEXT: "id": "0x{{.*}}",
|
|
|
|
// CHECK-NEXT: "kind": "CXXMethodDecl",
|
|
|
|
// CHECK-NEXT: "loc": {
|
2022-01-20 07:55:20 +08:00
|
|
|
// CHECK-NEXT: "offset": {{[0-9]+}},
|
2019-09-05 04:30:00 +08:00
|
|
|
// CHECK-NEXT: "line": 13,
|
|
|
|
// CHECK-NEXT: "col": 9,
|
|
|
|
// CHECK-NEXT: "tokLen": 6
|
|
|
|
// CHECK-NEXT: },
|
|
|
|
// CHECK-NEXT: "range": {
|
|
|
|
// CHECK-NEXT: "begin": {
|
2022-01-20 07:55:20 +08:00
|
|
|
// CHECK-NEXT: "offset": {{[0-9]+}},
|
2019-09-05 04:30:00 +08:00
|
|
|
// CHECK-NEXT: "col": 1,
|
|
|
|
// CHECK-NEXT: "tokLen": 4
|
|
|
|
// CHECK-NEXT: },
|
|
|
|
// CHECK-NEXT: "end": {
|
2022-01-20 07:55:20 +08:00
|
|
|
// CHECK-NEXT: "offset": {{[0-9]+}},
|
2019-09-05 04:30:00 +08:00
|
|
|
// CHECK-NEXT: "col": 19,
|
|
|
|
// CHECK-NEXT: "tokLen": 1
|
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: },
|
2019-10-16 01:30:19 +08:00
|
|
|
// CHECK-NEXT: "parentDeclContextId": "0x{{.*}}",
|
|
|
|
// CHECK-NEXT: "previousDecl": "0x{{.*}}",
|
2019-09-05 04:30:00 +08:00
|
|
|
// CHECK-NEXT: "name": "Method",
|
2019-11-15 20:33:16 +08:00
|
|
|
// CHECK-NEXT: "mangledName": "_ZN4Test1S6MethodEv",
|
2019-09-05 04:30:00 +08:00
|
|
|
// CHECK-NEXT: "type": {
|
|
|
|
// CHECK-NEXT: "qualType": "void ()"
|
|
|
|
// CHECK-NEXT: },
|
|
|
|
// CHECK-NEXT: "inner": [
|
|
|
|
// CHECK-NEXT: {
|
|
|
|
// CHECK-NEXT: "id": "0x{{.*}}",
|
|
|
|
// CHECK-NEXT: "kind": "CompoundStmt",
|
|
|
|
// CHECK-NEXT: "range": {
|
|
|
|
// CHECK-NEXT: "begin": {
|
2022-01-20 07:55:20 +08:00
|
|
|
// CHECK-NEXT: "offset": {{[0-9]+}},
|
2019-09-05 04:30:00 +08:00
|
|
|
// CHECK-NEXT: "col": 18,
|
|
|
|
// CHECK-NEXT: "tokLen": 1
|
|
|
|
// CHECK-NEXT: },
|
|
|
|
// CHECK-NEXT: "end": {
|
2022-01-20 07:55:20 +08:00
|
|
|
// CHECK-NEXT: "offset": {{[0-9]+}},
|
2019-09-05 04:30:00 +08:00
|
|
|
// CHECK-NEXT: "col": 19,
|
|
|
|
// CHECK-NEXT: "tokLen": 1
|
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: ]
|
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: ]
|
|
|
|
// CHECK-NEXT: }
|