From f7471edf8f58e814ef10c361e13738ac58e93a1e Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Fri, 21 Jun 2019 14:37:39 +0000 Subject: [PATCH] Add an automated note to files produced by gen_ast_dump_json_test.py. This also details what filters, if any, were used to generate the test output. Updates all the current JSON testing files to include the automated note. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@364055 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/AST/ast-dump-comment-json.cpp | 3 + test/AST/ast-dump-decl-json.c | 2 +- test/AST/ast-dump-decl-json.m | 2 + test/AST/ast-dump-enum-json.cpp | 900 +++++++++--------- test/AST/ast-dump-expr-json.c | 3 + test/AST/ast-dump-expr-json.cpp | 2 + test/AST/ast-dump-expr-json.m | 2 + test/AST/ast-dump-funcs-json.cpp | 3 +- test/AST/ast-dump-if-json.cpp | 3 + test/AST/ast-dump-macro-json.c | 3 + test/AST/ast-dump-namespace-json.cpp | 348 ++++--- .../ast-dump-record-definition-data-json.cpp | 3 + test/AST/ast-dump-records-json.cpp | 3 + test/AST/ast-dump-stmt-json.c | 3 +- test/AST/ast-dump-stmt-json.cpp | 3 + test/AST/ast-dump-stmt-json.m | 2 + test/AST/ast-dump-template-decls-json.cpp | 2 + test/AST/ast-dump-temporaries-json.cpp | 3 +- test/AST/gen_ast_dump_json_test.py | 7 + test/AST/multistep-explicit-cast-json.c | 4 +- test/AST/multistep-explicit-cast-json.cpp | 4 +- 21 files changed, 678 insertions(+), 627 deletions(-) diff --git a/test/AST/ast-dump-comment-json.cpp b/test/AST/ast-dump-comment-json.cpp index a909649c84..aee70ab87d 100644 --- a/test/AST/ast-dump-comment-json.cpp +++ b/test/AST/ast-dump-comment-json.cpp @@ -35,6 +35,9 @@ int Test_VerbatimBlockComment; template void Test_TemplatedFunctionVariadic(int arg, ...); +// NOTE: CHECK lines have been autogenerated by gen_ast_dump_json_test.py +// using --filters=FullComment + // CHECK: "kind": "FullComment", // CHECK-NEXT: "loc": { diff --git a/test/AST/ast-dump-decl-json.c b/test/AST/ast-dump-decl-json.c index 9b1313a0ea..c2583fafd2 100644 --- a/test/AST/ast-dump-decl-json.c +++ b/test/AST/ast-dump-decl-json.c @@ -86,6 +86,7 @@ int TestVarDeclInit = 0; void testParmVarDecl(int TestParmVarDecl); +// NOTE: CHECK lines have been autogenerated by gen_ast_dump_json_test.py // CHECK: "kind": "VarDecl", @@ -1668,4 +1669,3 @@ void testParmVarDecl(int TestParmVarDecl); // CHECK-NEXT: "qualType": "int" // CHECK-NEXT: } // CHECK-NEXT: } - diff --git a/test/AST/ast-dump-decl-json.m b/test/AST/ast-dump-decl-json.m index 88d306c70e..403bc7abbe 100644 --- a/test/AST/ast-dump-decl-json.m +++ b/test/AST/ast-dump-decl-json.m @@ -83,6 +83,8 @@ void f() { __typeof__(B.foo) Test; } +// NOTE: CHECK lines have been autogenerated by gen_ast_dump_json_test.py + // CHECK: "kind": "ObjCInterfaceDecl", // CHECK-NEXT: "loc": { diff --git a/test/AST/ast-dump-enum-json.cpp b/test/AST/ast-dump-enum-json.cpp index b8092f14aa..5e564df707 100644 --- a/test/AST/ast-dump-enum-json.cpp +++ b/test/AST/ast-dump-enum-json.cpp @@ -5,480 +5,488 @@ enum { Two }; -// CHECK: "kind": "EnumDecl", -// CHECK-NEXT: "loc": { -// CHECK-NEXT: "col": 1, -// CHECK-NEXT: "file": "{{.*}}", -// CHECK-NEXT: "line": 3 -// CHECK-NEXT: }, -// CHECK-NEXT: "range": { -// CHECK-NEXT: "begin": { -// CHECK-NEXT: "col": 1, -// CHECK-NEXT: "file": "{{.*}}", -// CHECK-NEXT: "line": 3 -// CHECK-NEXT: }, -// CHECK-NEXT: "end": { -// CHECK-NEXT: "col": 1, -// CHECK-NEXT: "file": "{{.*}}", -// CHECK-NEXT: "line": 6 -// CHECK-NEXT: } -// CHECK-NEXT: }, -// CHECK-NEXT: "inner": [ -// CHECK-NEXT: { -// CHECK-NEXT: "id": "0x{{.*}}", -// CHECK-NEXT: "kind": "EnumConstantDecl", -// CHECK-NEXT: "loc": { -// CHECK-NEXT: "col": 3, -// CHECK-NEXT: "file": "{{.*}}", -// CHECK-NEXT: "line": 4 -// CHECK-NEXT: }, -// CHECK-NEXT: "range": { -// CHECK-NEXT: "begin": { -// CHECK-NEXT: "col": 3, -// CHECK-NEXT: "file": "{{.*}}", -// CHECK-NEXT: "line": 4 -// CHECK-NEXT: }, -// CHECK-NEXT: "end": { -// CHECK-NEXT: "col": 3, -// CHECK-NEXT: "file": "{{.*}}", -// CHECK-NEXT: "line": 4 -// CHECK-NEXT: } -// CHECK-NEXT: }, -// CHECK-NEXT: "name": "One", -// CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "(anonymous enum at {{.*}}:3:1)" -// CHECK-NEXT: } -// CHECK-NEXT: }, -// CHECK-NEXT: { -// CHECK-NEXT: "id": "0x{{.*}}", -// CHECK-NEXT: "kind": "EnumConstantDecl", -// CHECK-NEXT: "loc": { -// CHECK-NEXT: "col": 3, -// CHECK-NEXT: "file": "{{.*}}", -// CHECK-NEXT: "line": 5 -// CHECK-NEXT: }, -// CHECK-NEXT: "range": { -// CHECK-NEXT: "begin": { -// CHECK-NEXT: "col": 3, -// CHECK-NEXT: "file": "{{.*}}", -// CHECK-NEXT: "line": 5 -// CHECK-NEXT: }, -// CHECK-NEXT: "end": { -// CHECK-NEXT: "col": 3, -// CHECK-NEXT: "file": "{{.*}}", -// CHECK-NEXT: "line": 5 -// CHECK-NEXT: } -// CHECK-NEXT: }, -// CHECK-NEXT: "name": "Two", -// CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "(anonymous enum at {{.*}}:3:1)" -// CHECK-NEXT: } -// CHECK-NEXT: } -// CHECK-NEXT: ] -// CHECK-NEXT: }, - enum E { Three, Four }; -// CHECK: "kind": "EnumDecl", -// CHECK-NEXT: "loc": { -// CHECK-NEXT: "col": 6, -// CHECK-NEXT: "file": "{{.*}}", -// CHECK-NEXT: "line": 80 -// CHECK-NEXT: }, -// CHECK-NEXT: "range": { -// CHECK-NEXT: "begin": { -// CHECK-NEXT: "col": 1, -// CHECK-NEXT: "file": "{{.*}}", -// CHECK-NEXT: "line": 80 -// CHECK-NEXT: }, -// CHECK-NEXT: "end": { -// CHECK-NEXT: "col": 1, -// CHECK-NEXT: "file": "{{.*}}", -// CHECK-NEXT: "line": 83 -// CHECK-NEXT: } -// CHECK-NEXT: }, -// CHECK-NEXT: "name": "E", -// CHECK-NEXT: "inner": [ -// CHECK-NEXT: { -// CHECK-NEXT: "id": "0x{{.*}}", -// CHECK-NEXT: "kind": "EnumConstantDecl", -// CHECK-NEXT: "loc": { -// CHECK-NEXT: "col": 3, -// CHECK-NEXT: "file": "{{.*}}", -// CHECK-NEXT: "line": 81 -// CHECK-NEXT: }, -// CHECK-NEXT: "range": { -// CHECK-NEXT: "begin": { -// CHECK-NEXT: "col": 3, -// CHECK-NEXT: "file": "{{.*}}", -// CHECK-NEXT: "line": 81 -// CHECK-NEXT: }, -// CHECK-NEXT: "end": { -// CHECK-NEXT: "col": 3, -// CHECK-NEXT: "file": "{{.*}}", -// CHECK-NEXT: "line": 81 -// CHECK-NEXT: } -// CHECK-NEXT: }, -// CHECK-NEXT: "name": "Three", -// CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "E" -// CHECK-NEXT: } -// CHECK-NEXT: }, -// CHECK-NEXT: { -// CHECK-NEXT: "id": "0x{{.*}}", -// CHECK-NEXT: "kind": "EnumConstantDecl", -// CHECK-NEXT: "loc": { -// CHECK-NEXT: "col": 3, -// CHECK-NEXT: "file": "{{.*}}", -// CHECK-NEXT: "line": 82 -// CHECK-NEXT: }, -// CHECK-NEXT: "range": { -// CHECK-NEXT: "begin": { -// CHECK-NEXT: "col": 3, -// CHECK-NEXT: "file": "{{.*}}", -// CHECK-NEXT: "line": 82 -// CHECK-NEXT: }, -// CHECK-NEXT: "end": { -// CHECK-NEXT: "col": 3, -// CHECK-NEXT: "file": "{{.*}}", -// CHECK-NEXT: "line": 82 -// CHECK-NEXT: } -// CHECK-NEXT: }, -// CHECK-NEXT: "name": "Four", -// CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "E" -// CHECK-NEXT: } -// CHECK-NEXT: } -// CHECK-NEXT: ] -// CHECK-NEXT: }, - enum F : short { Five, Six }; -// CHECK: "kind": "EnumDecl", -// CHECK-NEXT: "loc": { -// CHECK-NEXT: "col": 6, -// CHECK-NEXT: "file": "{{.*}}", -// CHECK-NEXT: "line": 158 -// CHECK-NEXT: }, -// CHECK-NEXT: "range": { -// CHECK-NEXT: "begin": { -// CHECK-NEXT: "col": 1, -// CHECK-NEXT: "file": "{{.*}}", -// CHECK-NEXT: "line": 158 -// CHECK-NEXT: }, -// CHECK-NEXT: "end": { -// CHECK-NEXT: "col": 1, -// CHECK-NEXT: "file": "{{.*}}", -// CHECK-NEXT: "line": 161 -// CHECK-NEXT: } -// CHECK-NEXT: }, -// CHECK-NEXT: "name": "F", -// CHECK-NEXT: "fixedUnderlyingType": { -// CHECK-NEXT: "qualType": "short" -// CHECK-NEXT: }, -// CHECK-NEXT: "inner": [ -// CHECK-NEXT: { -// CHECK-NEXT: "id": "0x{{.*}}", -// CHECK-NEXT: "kind": "EnumConstantDecl", -// CHECK-NEXT: "loc": { -// CHECK-NEXT: "col": 3, -// CHECK-NEXT: "file": "{{.*}}", -// CHECK-NEXT: "line": 159 -// CHECK-NEXT: }, -// CHECK-NEXT: "range": { -// CHECK-NEXT: "begin": { -// CHECK-NEXT: "col": 3, -// CHECK-NEXT: "file": "{{.*}}", -// CHECK-NEXT: "line": 159 -// CHECK-NEXT: }, -// CHECK-NEXT: "end": { -// CHECK-NEXT: "col": 3, -// CHECK-NEXT: "file": "{{.*}}", -// CHECK-NEXT: "line": 159 -// CHECK-NEXT: } -// CHECK-NEXT: }, -// CHECK-NEXT: "name": "Five", -// CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "F" -// CHECK-NEXT: } -// CHECK-NEXT: }, -// CHECK-NEXT: { -// CHECK-NEXT: "id": "0x{{.*}}", -// CHECK-NEXT: "kind": "EnumConstantDecl", -// CHECK-NEXT: "loc": { -// CHECK-NEXT: "col": 3, -// CHECK-NEXT: "file": "{{.*}}", -// CHECK-NEXT: "line": 160 -// CHECK-NEXT: }, -// CHECK-NEXT: "range": { -// CHECK-NEXT: "begin": { -// CHECK-NEXT: "col": 3, -// CHECK-NEXT: "file": "{{.*}}", -// CHECK-NEXT: "line": 160 -// CHECK-NEXT: }, -// CHECK-NEXT: "end": { -// CHECK-NEXT: "col": 3, -// CHECK-NEXT: "file": "{{.*}}", -// CHECK-NEXT: "line": 160 -// CHECK-NEXT: } -// CHECK-NEXT: }, -// CHECK-NEXT: "name": "Six", -// CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "F" -// CHECK-NEXT: } -// CHECK-NEXT: } -// CHECK-NEXT: ] -// CHECK-NEXT: }, - enum struct G { Seven, Eight }; -// CHECK: "kind": "EnumDecl", -// CHECK-NEXT: "loc": { -// CHECK-NEXT: "col": 13, -// CHECK-NEXT: "file": "{{.*}}", -// CHECK-NEXT: "line": 239 -// CHECK-NEXT: }, -// CHECK-NEXT: "range": { -// CHECK-NEXT: "begin": { -// CHECK-NEXT: "col": 1, -// CHECK-NEXT: "file": "{{.*}}", -// CHECK-NEXT: "line": 239 -// CHECK-NEXT: }, -// CHECK-NEXT: "end": { -// CHECK-NEXT: "col": 1, -// CHECK-NEXT: "file": "{{.*}}", -// CHECK-NEXT: "line": 242 -// CHECK-NEXT: } -// CHECK-NEXT: }, -// CHECK-NEXT: "name": "G", -// CHECK-NEXT: "fixedUnderlyingType": { -// CHECK-NEXT: "qualType": "int" -// CHECK-NEXT: }, -// CHECK-NEXT: "scopedEnumTag": "struct", -// CHECK-NEXT: "inner": [ -// CHECK-NEXT: { -// CHECK-NEXT: "id": "0x{{.*}}", -// CHECK-NEXT: "kind": "EnumConstantDecl", -// CHECK-NEXT: "loc": { -// CHECK-NEXT: "col": 3, -// CHECK-NEXT: "file": "{{.*}}", -// CHECK-NEXT: "line": 240 -// CHECK-NEXT: }, -// CHECK-NEXT: "range": { -// CHECK-NEXT: "begin": { -// CHECK-NEXT: "col": 3, -// CHECK-NEXT: "file": "{{.*}}", -// CHECK-NEXT: "line": 240 -// CHECK-NEXT: }, -// CHECK-NEXT: "end": { -// CHECK-NEXT: "col": 3, -// CHECK-NEXT: "file": "{{.*}}", -// CHECK-NEXT: "line": 240 -// CHECK-NEXT: } -// CHECK-NEXT: }, -// CHECK-NEXT: "name": "Seven", -// CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "G" -// CHECK-NEXT: } -// CHECK-NEXT: }, -// CHECK-NEXT: { -// CHECK-NEXT: "id": "0x{{.*}}", -// CHECK-NEXT: "kind": "EnumConstantDecl", -// CHECK-NEXT: "loc": { -// CHECK-NEXT: "col": 3, -// CHECK-NEXT: "file": "{{.*}}", -// CHECK-NEXT: "line": 241 -// CHECK-NEXT: }, -// CHECK-NEXT: "range": { -// CHECK-NEXT: "begin": { -// CHECK-NEXT: "col": 3, -// CHECK-NEXT: "file": "{{.*}}", -// CHECK-NEXT: "line": 241 -// CHECK-NEXT: }, -// CHECK-NEXT: "end": { -// CHECK-NEXT: "col": 3, -// CHECK-NEXT: "file": "{{.*}}", -// CHECK-NEXT: "line": 241 -// CHECK-NEXT: } -// CHECK-NEXT: }, -// CHECK-NEXT: "name": "Eight", -// CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "G" -// CHECK-NEXT: } -// CHECK-NEXT: } -// CHECK-NEXT: ] -// CHECK-NEXT: }, - enum class H { Nine, Ten }; -// CHECK: "kind": "EnumDecl", -// CHECK-NEXT: "loc": { -// CHECK-NEXT: "col": 12, -// CHECK-NEXT: "file": "{{.*}}", -// CHECK-NEXT: "line": 321 -// CHECK-NEXT: }, -// CHECK-NEXT: "range": { -// CHECK-NEXT: "begin": { -// CHECK-NEXT: "col": 1, -// CHECK-NEXT: "file": "{{.*}}", -// CHECK-NEXT: "line": 321 -// CHECK-NEXT: }, -// CHECK-NEXT: "end": { -// CHECK-NEXT: "col": 1, -// CHECK-NEXT: "file": "{{.*}}", -// CHECK-NEXT: "line": 324 -// CHECK-NEXT: } -// CHECK-NEXT: }, -// CHECK-NEXT: "name": "H", -// CHECK-NEXT: "fixedUnderlyingType": { -// CHECK-NEXT: "qualType": "int" -// CHECK-NEXT: }, -// CHECK-NEXT: "scopedEnumTag": "class", -// CHECK-NEXT: "inner": [ -// CHECK-NEXT: { -// CHECK-NEXT: "id": "0x{{.*}}", -// CHECK-NEXT: "kind": "EnumConstantDecl", -// CHECK-NEXT: "loc": { -// CHECK-NEXT: "col": 3, -// CHECK-NEXT: "file": "{{.*}}", -// CHECK-NEXT: "line": 322 -// CHECK-NEXT: }, -// CHECK-NEXT: "range": { -// CHECK-NEXT: "begin": { -// CHECK-NEXT: "col": 3, -// CHECK-NEXT: "file": "{{.*}}", -// CHECK-NEXT: "line": 322 -// CHECK-NEXT: }, -// CHECK-NEXT: "end": { -// CHECK-NEXT: "col": 3, -// CHECK-NEXT: "file": "{{.*}}", -// CHECK-NEXT: "line": 322 -// CHECK-NEXT: } -// CHECK-NEXT: }, -// CHECK-NEXT: "name": "Nine", -// CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "H" -// CHECK-NEXT: } -// CHECK-NEXT: }, -// CHECK-NEXT: { -// CHECK-NEXT: "id": "0x{{.*}}", -// CHECK-NEXT: "kind": "EnumConstantDecl", -// CHECK-NEXT: "loc": { -// CHECK-NEXT: "col": 3, -// CHECK-NEXT: "file": "{{.*}}", -// CHECK-NEXT: "line": 323 -// CHECK-NEXT: }, -// CHECK-NEXT: "range": { -// CHECK-NEXT: "begin": { -// CHECK-NEXT: "col": 3, -// CHECK-NEXT: "file": "{{.*}}", -// CHECK-NEXT: "line": 323 -// CHECK-NEXT: }, -// CHECK-NEXT: "end": { -// CHECK-NEXT: "col": 3, -// CHECK-NEXT: "file": "{{.*}}", -// CHECK-NEXT: "line": 323 -// CHECK-NEXT: } -// CHECK-NEXT: }, -// CHECK-NEXT: "name": "Ten", -// CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "H" -// CHECK-NEXT: } -// CHECK-NEXT: } -// CHECK-NEXT: ] -// CHECK-NEXT: }, - enum class I : int { Eleven, Twelve }; -// CHECK: "kind": "EnumDecl", -// CHECK-NEXT: "loc": { -// CHECK-NEXT: "col": 12, -// CHECK-NEXT: "file": "{{.*}}", -// CHECK-NEXT: "line": 403 -// CHECK-NEXT: }, -// CHECK-NEXT: "range": { -// CHECK-NEXT: "begin": { -// CHECK-NEXT: "col": 1, -// CHECK-NEXT: "file": "{{.*}}", -// CHECK-NEXT: "line": 403 -// CHECK-NEXT: }, -// CHECK-NEXT: "end": { -// CHECK-NEXT: "col": 1, -// CHECK-NEXT: "file": "{{.*}}", -// CHECK-NEXT: "line": 406 -// CHECK-NEXT: } -// CHECK-NEXT: }, -// CHECK-NEXT: "name": "I", -// CHECK-NEXT: "fixedUnderlyingType": { -// CHECK-NEXT: "qualType": "int" -// CHECK-NEXT: }, -// CHECK-NEXT: "scopedEnumTag": "class", -// CHECK-NEXT: "inner": [ -// CHECK-NEXT: { -// CHECK-NEXT: "id": "0x{{.*}}", -// CHECK-NEXT: "kind": "EnumConstantDecl", -// CHECK-NEXT: "loc": { -// CHECK-NEXT: "col": 3, -// CHECK-NEXT: "file": "{{.*}}", -// CHECK-NEXT: "line": 404 -// CHECK-NEXT: }, -// CHECK-NEXT: "range": { -// CHECK-NEXT: "begin": { -// CHECK-NEXT: "col": 3, -// CHECK-NEXT: "file": "{{.*}}", -// CHECK-NEXT: "line": 404 -// CHECK-NEXT: }, -// CHECK-NEXT: "end": { -// CHECK-NEXT: "col": 3, -// CHECK-NEXT: "file": "{{.*}}", -// CHECK-NEXT: "line": 404 +// NOTE: CHECK lines have been autogenerated by gen_ast_dump_json_test.py +// using --filters=EnumDecl + + +// CHECK: "kind": "EnumDecl", +// CHECK-NEXT: "loc": { +// CHECK-NEXT: "col": 1, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 3 +// CHECK-NEXT: }, +// CHECK-NEXT: "range": { +// CHECK-NEXT: "begin": { +// CHECK-NEXT: "col": 1, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 3 +// CHECK-NEXT: }, +// CHECK-NEXT: "end": { +// CHECK-NEXT: "col": 1, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 6 +// CHECK-NEXT: } +// CHECK-NEXT: }, +// CHECK-NEXT: "inner": [ +// CHECK-NEXT: { +// CHECK-NEXT: "id": "0x{{.*}}", +// CHECK-NEXT: "kind": "EnumConstantDecl", +// CHECK-NEXT: "loc": { +// CHECK-NEXT: "col": 3, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 4 +// CHECK-NEXT: }, +// CHECK-NEXT: "range": { +// CHECK-NEXT: "begin": { +// CHECK-NEXT: "col": 3, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 4 +// CHECK-NEXT: }, +// CHECK-NEXT: "end": { +// CHECK-NEXT: "col": 3, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 4 +// CHECK-NEXT: } +// CHECK-NEXT: }, +// CHECK-NEXT: "name": "One", +// CHECK-NEXT: "type": { +// CHECK-NEXT: "qualType": "(anonymous enum at {{.*}}:3:1)" +// CHECK-NEXT: } +// CHECK-NEXT: }, +// CHECK-NEXT: { +// CHECK-NEXT: "id": "0x{{.*}}", +// CHECK-NEXT: "kind": "EnumConstantDecl", +// CHECK-NEXT: "loc": { +// CHECK-NEXT: "col": 3, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 5 +// CHECK-NEXT: }, +// CHECK-NEXT: "range": { +// CHECK-NEXT: "begin": { +// CHECK-NEXT: "col": 3, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 5 +// CHECK-NEXT: }, +// CHECK-NEXT: "end": { +// CHECK-NEXT: "col": 3, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 5 +// CHECK-NEXT: } +// CHECK-NEXT: }, +// CHECK-NEXT: "name": "Two", +// CHECK-NEXT: "type": { +// CHECK-NEXT: "qualType": "(anonymous enum at {{.*}}:3:1)" +// CHECK-NEXT: } +// CHECK-NEXT: } +// CHECK-NEXT: ] // CHECK-NEXT: } -// CHECK-NEXT: }, -// CHECK-NEXT: "name": "Eleven", -// CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "I" + + +// CHECK: "kind": "EnumDecl", +// CHECK-NEXT: "loc": { +// CHECK-NEXT: "col": 6, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 8 +// CHECK-NEXT: }, +// CHECK-NEXT: "range": { +// CHECK-NEXT: "begin": { +// CHECK-NEXT: "col": 1, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 8 +// CHECK-NEXT: }, +// CHECK-NEXT: "end": { +// CHECK-NEXT: "col": 1, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 11 +// CHECK-NEXT: } +// CHECK-NEXT: }, +// CHECK-NEXT: "name": "E", +// CHECK-NEXT: "inner": [ +// CHECK-NEXT: { +// CHECK-NEXT: "id": "0x{{.*}}", +// CHECK-NEXT: "kind": "EnumConstantDecl", +// CHECK-NEXT: "loc": { +// CHECK-NEXT: "col": 3, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 9 +// CHECK-NEXT: }, +// CHECK-NEXT: "range": { +// CHECK-NEXT: "begin": { +// CHECK-NEXT: "col": 3, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 9 +// CHECK-NEXT: }, +// CHECK-NEXT: "end": { +// CHECK-NEXT: "col": 3, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 9 +// CHECK-NEXT: } +// CHECK-NEXT: }, +// CHECK-NEXT: "name": "Three", +// CHECK-NEXT: "type": { +// CHECK-NEXT: "qualType": "E" +// CHECK-NEXT: } +// CHECK-NEXT: }, +// CHECK-NEXT: { +// CHECK-NEXT: "id": "0x{{.*}}", +// CHECK-NEXT: "kind": "EnumConstantDecl", +// CHECK-NEXT: "loc": { +// CHECK-NEXT: "col": 3, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 10 +// CHECK-NEXT: }, +// CHECK-NEXT: "range": { +// CHECK-NEXT: "begin": { +// CHECK-NEXT: "col": 3, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 10 +// CHECK-NEXT: }, +// CHECK-NEXT: "end": { +// CHECK-NEXT: "col": 3, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 10 +// CHECK-NEXT: } +// CHECK-NEXT: }, +// CHECK-NEXT: "name": "Four", +// CHECK-NEXT: "type": { +// CHECK-NEXT: "qualType": "E" +// CHECK-NEXT: } +// CHECK-NEXT: } +// CHECK-NEXT: ] // CHECK-NEXT: } -// CHECK-NEXT: }, -// CHECK-NEXT: { -// CHECK-NEXT: "id": "0x{{.*}}", -// CHECK-NEXT: "kind": "EnumConstantDecl", -// CHECK-NEXT: "loc": { -// CHECK-NEXT: "col": 3, -// CHECK-NEXT: "file": "{{.*}}", -// CHECK-NEXT: "line": 405 -// CHECK-NEXT: }, -// CHECK-NEXT: "range": { -// CHECK-NEXT: "begin": { -// CHECK-NEXT: "col": 3, -// CHECK-NEXT: "file": "{{.*}}", -// CHECK-NEXT: "line": 405 -// CHECK-NEXT: }, -// CHECK-NEXT: "end": { -// CHECK-NEXT: "col": 3, -// CHECK-NEXT: "file": "{{.*}}", -// CHECK-NEXT: "line": 405 + + +// CHECK: "kind": "EnumDecl", +// CHECK-NEXT: "loc": { +// CHECK-NEXT: "col": 6, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 13 +// CHECK-NEXT: }, +// CHECK-NEXT: "range": { +// CHECK-NEXT: "begin": { +// CHECK-NEXT: "col": 1, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 13 +// CHECK-NEXT: }, +// CHECK-NEXT: "end": { +// CHECK-NEXT: "col": 1, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 16 +// CHECK-NEXT: } +// CHECK-NEXT: }, +// CHECK-NEXT: "name": "F", +// CHECK-NEXT: "fixedUnderlyingType": { +// CHECK-NEXT: "qualType": "short" +// CHECK-NEXT: }, +// CHECK-NEXT: "inner": [ +// CHECK-NEXT: { +// CHECK-NEXT: "id": "0x{{.*}}", +// CHECK-NEXT: "kind": "EnumConstantDecl", +// CHECK-NEXT: "loc": { +// CHECK-NEXT: "col": 3, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 14 +// CHECK-NEXT: }, +// CHECK-NEXT: "range": { +// CHECK-NEXT: "begin": { +// CHECK-NEXT: "col": 3, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 14 +// CHECK-NEXT: }, +// CHECK-NEXT: "end": { +// CHECK-NEXT: "col": 3, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 14 +// CHECK-NEXT: } +// CHECK-NEXT: }, +// CHECK-NEXT: "name": "Five", +// CHECK-NEXT: "type": { +// CHECK-NEXT: "qualType": "F" +// CHECK-NEXT: } +// CHECK-NEXT: }, +// CHECK-NEXT: { +// CHECK-NEXT: "id": "0x{{.*}}", +// CHECK-NEXT: "kind": "EnumConstantDecl", +// CHECK-NEXT: "loc": { +// CHECK-NEXT: "col": 3, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 15 +// CHECK-NEXT: }, +// CHECK-NEXT: "range": { +// CHECK-NEXT: "begin": { +// CHECK-NEXT: "col": 3, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 15 +// CHECK-NEXT: }, +// CHECK-NEXT: "end": { +// CHECK-NEXT: "col": 3, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 15 +// CHECK-NEXT: } +// CHECK-NEXT: }, +// CHECK-NEXT: "name": "Six", +// CHECK-NEXT: "type": { +// CHECK-NEXT: "qualType": "F" +// CHECK-NEXT: } +// CHECK-NEXT: } +// CHECK-NEXT: ] // CHECK-NEXT: } -// CHECK-NEXT: }, -// CHECK-NEXT: "name": "Twelve", -// CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "I" + + +// CHECK: "kind": "EnumDecl", +// CHECK-NEXT: "loc": { +// CHECK-NEXT: "col": 13, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 18 +// CHECK-NEXT: }, +// CHECK-NEXT: "range": { +// CHECK-NEXT: "begin": { +// CHECK-NEXT: "col": 1, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 18 +// CHECK-NEXT: }, +// CHECK-NEXT: "end": { +// CHECK-NEXT: "col": 1, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 21 +// CHECK-NEXT: } +// CHECK-NEXT: }, +// CHECK-NEXT: "name": "G", +// CHECK-NEXT: "fixedUnderlyingType": { +// CHECK-NEXT: "qualType": "int" +// CHECK-NEXT: }, +// CHECK-NEXT: "scopedEnumTag": "struct", +// CHECK-NEXT: "inner": [ +// CHECK-NEXT: { +// CHECK-NEXT: "id": "0x{{.*}}", +// CHECK-NEXT: "kind": "EnumConstantDecl", +// CHECK-NEXT: "loc": { +// CHECK-NEXT: "col": 3, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 19 +// CHECK-NEXT: }, +// CHECK-NEXT: "range": { +// CHECK-NEXT: "begin": { +// CHECK-NEXT: "col": 3, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 19 +// CHECK-NEXT: }, +// CHECK-NEXT: "end": { +// CHECK-NEXT: "col": 3, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 19 +// CHECK-NEXT: } +// CHECK-NEXT: }, +// CHECK-NEXT: "name": "Seven", +// CHECK-NEXT: "type": { +// CHECK-NEXT: "qualType": "G" +// CHECK-NEXT: } +// CHECK-NEXT: }, +// CHECK-NEXT: { +// CHECK-NEXT: "id": "0x{{.*}}", +// CHECK-NEXT: "kind": "EnumConstantDecl", +// CHECK-NEXT: "loc": { +// CHECK-NEXT: "col": 3, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 20 +// CHECK-NEXT: }, +// CHECK-NEXT: "range": { +// CHECK-NEXT: "begin": { +// CHECK-NEXT: "col": 3, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 20 +// CHECK-NEXT: }, +// CHECK-NEXT: "end": { +// CHECK-NEXT: "col": 3, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 20 +// CHECK-NEXT: } +// CHECK-NEXT: }, +// CHECK-NEXT: "name": "Eight", +// CHECK-NEXT: "type": { +// CHECK-NEXT: "qualType": "G" +// CHECK-NEXT: } +// CHECK-NEXT: } +// CHECK-NEXT: ] // CHECK-NEXT: } + + +// CHECK: "kind": "EnumDecl", +// CHECK-NEXT: "loc": { +// CHECK-NEXT: "col": 12, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 23 +// CHECK-NEXT: }, +// CHECK-NEXT: "range": { +// CHECK-NEXT: "begin": { +// CHECK-NEXT: "col": 1, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 23 +// CHECK-NEXT: }, +// CHECK-NEXT: "end": { +// CHECK-NEXT: "col": 1, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 26 +// CHECK-NEXT: } +// CHECK-NEXT: }, +// CHECK-NEXT: "name": "H", +// CHECK-NEXT: "fixedUnderlyingType": { +// CHECK-NEXT: "qualType": "int" +// CHECK-NEXT: }, +// CHECK-NEXT: "scopedEnumTag": "class", +// CHECK-NEXT: "inner": [ +// CHECK-NEXT: { +// CHECK-NEXT: "id": "0x{{.*}}", +// CHECK-NEXT: "kind": "EnumConstantDecl", +// CHECK-NEXT: "loc": { +// CHECK-NEXT: "col": 3, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 24 +// CHECK-NEXT: }, +// CHECK-NEXT: "range": { +// CHECK-NEXT: "begin": { +// CHECK-NEXT: "col": 3, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 24 +// CHECK-NEXT: }, +// CHECK-NEXT: "end": { +// CHECK-NEXT: "col": 3, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 24 +// CHECK-NEXT: } +// CHECK-NEXT: }, +// CHECK-NEXT: "name": "Nine", +// CHECK-NEXT: "type": { +// CHECK-NEXT: "qualType": "H" +// CHECK-NEXT: } +// CHECK-NEXT: }, +// CHECK-NEXT: { +// CHECK-NEXT: "id": "0x{{.*}}", +// CHECK-NEXT: "kind": "EnumConstantDecl", +// CHECK-NEXT: "loc": { +// CHECK-NEXT: "col": 3, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 25 +// CHECK-NEXT: }, +// CHECK-NEXT: "range": { +// CHECK-NEXT: "begin": { +// CHECK-NEXT: "col": 3, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 25 +// CHECK-NEXT: }, +// CHECK-NEXT: "end": { +// CHECK-NEXT: "col": 3, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 25 +// CHECK-NEXT: } +// CHECK-NEXT: }, +// CHECK-NEXT: "name": "Ten", +// CHECK-NEXT: "type": { +// CHECK-NEXT: "qualType": "H" +// CHECK-NEXT: } +// CHECK-NEXT: } +// CHECK-NEXT: ] // CHECK-NEXT: } -// CHECK-NEXT: ] + + +// CHECK: "kind": "EnumDecl", +// CHECK-NEXT: "loc": { +// CHECK-NEXT: "col": 12, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 28 +// CHECK-NEXT: }, +// CHECK-NEXT: "range": { +// CHECK-NEXT: "begin": { +// CHECK-NEXT: "col": 1, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 28 +// CHECK-NEXT: }, +// CHECK-NEXT: "end": { +// CHECK-NEXT: "col": 1, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 31 +// CHECK-NEXT: } +// CHECK-NEXT: }, +// CHECK-NEXT: "name": "I", +// CHECK-NEXT: "fixedUnderlyingType": { +// CHECK-NEXT: "qualType": "int" +// CHECK-NEXT: }, +// CHECK-NEXT: "scopedEnumTag": "class", +// CHECK-NEXT: "inner": [ +// CHECK-NEXT: { +// CHECK-NEXT: "id": "0x{{.*}}", +// CHECK-NEXT: "kind": "EnumConstantDecl", +// CHECK-NEXT: "loc": { +// CHECK-NEXT: "col": 3, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 29 +// CHECK-NEXT: }, +// CHECK-NEXT: "range": { +// CHECK-NEXT: "begin": { +// CHECK-NEXT: "col": 3, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 29 +// CHECK-NEXT: }, +// CHECK-NEXT: "end": { +// CHECK-NEXT: "col": 3, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 29 +// CHECK-NEXT: } +// CHECK-NEXT: }, +// CHECK-NEXT: "name": "Eleven", +// CHECK-NEXT: "type": { +// CHECK-NEXT: "qualType": "I" +// CHECK-NEXT: } +// CHECK-NEXT: }, +// CHECK-NEXT: { +// CHECK-NEXT: "id": "0x{{.*}}", +// CHECK-NEXT: "kind": "EnumConstantDecl", +// CHECK-NEXT: "loc": { +// CHECK-NEXT: "col": 3, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 30 +// CHECK-NEXT: }, +// CHECK-NEXT: "range": { +// CHECK-NEXT: "begin": { +// CHECK-NEXT: "col": 3, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 30 +// CHECK-NEXT: }, +// CHECK-NEXT: "end": { +// CHECK-NEXT: "col": 3, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 30 +// CHECK-NEXT: } +// CHECK-NEXT: }, +// CHECK-NEXT: "name": "Twelve", +// CHECK-NEXT: "type": { +// CHECK-NEXT: "qualType": "I" +// CHECK-NEXT: } +// CHECK-NEXT: } +// CHECK-NEXT: ] // CHECK-NEXT: } -// CHECK-NEXT: ] diff --git a/test/AST/ast-dump-expr-json.c b/test/AST/ast-dump-expr-json.c index 5dd86f38f5..a27d615883 100644 --- a/test/AST/ast-dump-expr-json.c +++ b/test/AST/ast-dump-expr-json.c @@ -105,6 +105,9 @@ void PrimaryExpressions(int a) { (a); } +// NOTE: CHECK lines have been autogenerated by gen_ast_dump_json_test.py +// using --filters=FunctionDecl + // CHECK: "kind": "FunctionDecl", // CHECK-NEXT: "loc": { diff --git a/test/AST/ast-dump-expr-json.cpp b/test/AST/ast-dump-expr-json.cpp index 59d1e229a9..8a4bfdf777 100644 --- a/test/AST/ast-dump-expr-json.cpp +++ b/test/AST/ast-dump-expr-json.cpp @@ -153,6 +153,8 @@ void TestNonADLCall3() { } } // namespace test_adl_call_three +// NOTE: CHECK lines have been autogenerated by gen_ast_dump_json_test.py + // CHECK: "kind": "FunctionDecl", // CHECK-NEXT: "loc": { diff --git a/test/AST/ast-dump-expr-json.m b/test/AST/ast-dump-expr-json.m index f0ec7d4373..9f6dac78ba 100644 --- a/test/AST/ast-dump-expr-json.m +++ b/test/AST/ast-dump-expr-json.m @@ -95,6 +95,8 @@ void TestObjCBoolLiteral() { __objc_no; } +// NOTE: CHECK lines have been autogenerated by gen_ast_dump_json_test.py + // CHECK: "kind": "FunctionDecl", // CHECK-NEXT: "loc": { diff --git a/test/AST/ast-dump-funcs-json.cpp b/test/AST/ast-dump-funcs-json.cpp index b69a6e20ca..ef3215d182 100644 --- a/test/AST/ast-dump-funcs-json.cpp +++ b/test/AST/ast-dump-funcs-json.cpp @@ -41,6 +41,8 @@ int main() { Test1(); // Causes this to be marked 'used' } +// NOTE: CHECK lines have been autogenerated by gen_ast_dump_json_test.py + // CHECK: "kind": "CXXMethodDecl", // CHECK-NEXT: "loc": { @@ -1121,4 +1123,3 @@ int main() { // CHECK-NEXT: } // CHECK-NEXT: ] // CHECK-NEXT: } - diff --git a/test/AST/ast-dump-if-json.cpp b/test/AST/ast-dump-if-json.cpp index 1d10329211..49d711ab88 100644 --- a/test/AST/ast-dump-if-json.cpp +++ b/test/AST/ast-dump-if-json.cpp @@ -26,6 +26,9 @@ void func(int val) { ; } +// NOTE: CHECK lines have been autogenerated by gen_ast_dump_json_test.py +// using --filters=IfStmt + // CHECK: "kind": "IfStmt", // CHECK-NEXT: "range": { diff --git a/test/AST/ast-dump-macro-json.c b/test/AST/ast-dump-macro-json.c index 14b88adcfa..43a9df0fd6 100644 --- a/test/AST/ast-dump-macro-json.c +++ b/test/AST/ast-dump-macro-json.c @@ -16,6 +16,9 @@ void BING(quux)(void); void BLAP(foo, __COUNTER__)(void); void BLAP(foo, __COUNTER__)(void); +// NOTE: CHECK lines have been autogenerated by gen_ast_dump_json_test.py +// using --filters=FunctionDecl + // CHECK: "kind": "FunctionDecl", // CHECK-NEXT: "loc": { diff --git a/test/AST/ast-dump-namespace-json.cpp b/test/AST/ast-dump-namespace-json.cpp index 1cf967d735..3162fb8cd6 100644 --- a/test/AST/ast-dump-namespace-json.cpp +++ b/test/AST/ast-dump-namespace-json.cpp @@ -2,210 +2,208 @@ namespace foo { } -// CHECK: "kind": "NamespaceDecl", -// CHECK-NEXT: "loc": { -// CHECK-NEXT: "col": 11, -// CHECK-NEXT: "file": "{{.*}}", -// CHECK-NEXT: "line": 3 -// CHECK-NEXT: }, -// CHECK-NEXT: "range": { -// CHECK-NEXT: "begin": { -// CHECK-NEXT: "col": 1, -// CHECK-NEXT: "file": "{{.*}}", -// CHECK-NEXT: "line": 3 -// CHECK-NEXT: }, -// CHECK-NEXT: "end": { -// CHECK-NEXT: "col": 1, -// CHECK-NEXT: "file": "{{.*}}", -// CHECK-NEXT: "line": 4 -// CHECK-NEXT: } -// CHECK-NEXT: }, -// CHECK-NEXT: "name": "foo" -// CHECK-NEXT: }, - namespace { } -// CHECK: "kind": "NamespaceDecl", -// CHECK-NEXT: "loc": { -// CHECK-NEXT: "col": 11, -// CHECK-NEXT: "file": "{{.*}}", -// CHECK-NEXT: "line": 27 -// CHECK-NEXT: }, -// CHECK-NEXT: "range": { -// CHECK-NEXT: "begin": { -// CHECK-NEXT: "col": 1, -// CHECK-NEXT: "file": "{{.*}}", -// CHECK-NEXT: "line": 27 -// CHECK-NEXT: }, -// CHECK-NEXT: "end": { -// CHECK-NEXT: "col": 1, -// CHECK-NEXT: "file": "{{.*}}", -// CHECK-NEXT: "line": 28 -// CHECK-NEXT: } -// CHECK-NEXT: } -// CHECK-NEXT: }, -// CHECK-NEXT: { -// CHECK-NEXT: "id": "0x{{.*}}", -// CHECK-NEXT: "kind": "UsingDirectiveDecl", -// CHECK-NEXT: "loc": {}, -// CHECK-NEXT: "range": { -// CHECK-NEXT: "begin": { -// CHECK-NEXT: "col": 11, -// CHECK-NEXT: "file": "{{.*}}", -// CHECK-NEXT: "line": 27 -// CHECK-NEXT: }, -// CHECK-NEXT: "end": {} -// CHECK-NEXT: }, -// CHECK-NEXT: "isImplicit": true, -// CHECK-NEXT: "nominatedNamespace": { -// CHECK-NEXT: "id": "0x{{.*}}", -// CHECK-NEXT: "kind": "NamespaceDecl", -// CHECK-NEXT: "name": "" -// CHECK-NEXT: } -// CHECK-NEXT: }, namespace bar { inline namespace __1 { } } -// CHECK: "kind": "NamespaceDecl", -// CHECK-NEXT: "loc": { -// CHECK-NEXT: "col": 11, -// CHECK-NEXT: "file": "{{.*}}", -// CHECK-NEXT: "line": 68 -// CHECK-NEXT: }, -// CHECK-NEXT: "range": { -// CHECK-NEXT: "begin": { -// CHECK-NEXT: "col": 1, -// CHECK-NEXT: "file": "{{.*}}", -// CHECK-NEXT: "line": 68 -// CHECK-NEXT: }, -// CHECK-NEXT: "end": { -// CHECK-NEXT: "col": 1, -// CHECK-NEXT: "file": "{{.*}}", -// CHECK-NEXT: "line": 71 + +namespace baz::quux { +} + +namespace quux::inline frobble { +} + +// NOTE: CHECK lines have been autogenerated by gen_ast_dump_json_test.py +// using --filters=NamespaceDecl + + +// CHECK: "kind": "NamespaceDecl", +// CHECK-NEXT: "loc": { +// CHECK-NEXT: "col": 11, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 3 +// CHECK-NEXT: }, +// CHECK-NEXT: "range": { +// CHECK-NEXT: "begin": { +// CHECK-NEXT: "col": 1, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 3 +// CHECK-NEXT: }, +// CHECK-NEXT: "end": { +// CHECK-NEXT: "col": 1, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 4 +// CHECK-NEXT: } +// CHECK-NEXT: }, +// CHECK-NEXT: "name": "foo" +// CHECK-NEXT: } + + +// CHECK: "kind": "NamespaceDecl", +// CHECK-NEXT: "loc": { +// CHECK-NEXT: "col": 11, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 6 +// CHECK-NEXT: }, +// CHECK-NEXT: "range": { +// CHECK-NEXT: "begin": { +// CHECK-NEXT: "col": 1, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 6 +// CHECK-NEXT: }, +// CHECK-NEXT: "end": { +// CHECK-NEXT: "col": 1, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 7 +// CHECK-NEXT: } +// CHECK-NEXT: } +// CHECK-NEXT: } + + +// CHECK: "kind": "NamespaceDecl", +// CHECK-NEXT: "name": "" // CHECK-NEXT: } -// CHECK-NEXT: }, -// CHECK-NEXT: "name": "bar", -// CHECK-NEXT: "inner": [ -// CHECK-NEXT: { -// CHECK-NEXT: "id": "0x{{.*}}", -// CHECK-NEXT: "kind": "NamespaceDecl", -// CHECK-NEXT: "loc": { + + +// CHECK: "kind": "NamespaceDecl", +// CHECK-NEXT: "loc": { +// CHECK-NEXT: "col": 11, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 9 +// CHECK-NEXT: }, +// CHECK-NEXT: "range": { +// CHECK-NEXT: "begin": { +// CHECK-NEXT: "col": 1, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 9 +// CHECK-NEXT: }, +// CHECK-NEXT: "end": { +// CHECK-NEXT: "col": 1, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 12 +// CHECK-NEXT: } +// CHECK-NEXT: }, +// CHECK-NEXT: "name": "bar", +// CHECK-NEXT: "inner": [ +// CHECK-NEXT: { +// CHECK-NEXT: "id": "0x{{.*}}", +// CHECK-NEXT: "kind": "NamespaceDecl", +// CHECK-NEXT: "loc": { // CHECK-NEXT: "col": 18, // CHECK-NEXT: "file": "{{.*}}", -// CHECK-NEXT: "line": 69 -// CHECK-NEXT: }, -// CHECK-NEXT: "range": { +// CHECK-NEXT: "line": 10 +// CHECK-NEXT: }, +// CHECK-NEXT: "range": { // CHECK-NEXT: "begin": { -// CHECK-NEXT: "col": 1, -// CHECK-NEXT: "file": "{{.*}}", -// CHECK-NEXT: "line": 69 +// CHECK-NEXT: "col": 1, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 10 // CHECK-NEXT: }, // CHECK-NEXT: "end": { -// CHECK-NEXT: "col": 1, -// CHECK-NEXT: "file": "{{.*}}", -// CHECK-NEXT: "line": 70 +// CHECK-NEXT: "col": 1, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 11 // CHECK-NEXT: } -// CHECK-NEXT: }, -// CHECK-NEXT: "name": "__1", -// CHECK-NEXT: "isInline": true +// CHECK-NEXT: }, +// CHECK-NEXT: "name": "__1", +// CHECK-NEXT: "isInline": true +// CHECK-NEXT: } +// CHECK-NEXT: ] // CHECK-NEXT: } -// CHECK-NEXT: ] -// CHECK-NEXT: }, -namespace baz::quux { -} -// CHECK: "kind": "NamespaceDecl", -// CHECK-NEXT: "loc": { -// CHECK-NEXT: "col": 11, -// CHECK-NEXT: "file": "{{.*}}", -// CHECK-NEXT: "line": 118 -// CHECK-NEXT: }, -// CHECK-NEXT: "range": { -// CHECK-NEXT: "begin": { -// CHECK-NEXT: "col": 1, -// CHECK-NEXT: "file": "{{.*}}", -// CHECK-NEXT: "line": 118 -// CHECK-NEXT: }, -// CHECK-NEXT: "end": { -// CHECK-NEXT: "col": 1, -// CHECK-NEXT: "file": "{{.*}}", -// CHECK-NEXT: "line": 119 -// CHECK-NEXT: } -// CHECK-NEXT: }, -// CHECK-NEXT: "name": "baz", -// CHECK-NEXT: "inner": [ -// CHECK-NEXT: { -// CHECK-NEXT: "id": "0x{{.*}}", -// CHECK-NEXT: "kind": "NamespaceDecl", -// CHECK-NEXT: "loc": { + +// CHECK: "kind": "NamespaceDecl", +// CHECK-NEXT: "loc": { +// CHECK-NEXT: "col": 11, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 14 +// CHECK-NEXT: }, +// CHECK-NEXT: "range": { +// CHECK-NEXT: "begin": { +// CHECK-NEXT: "col": 1, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 14 +// CHECK-NEXT: }, +// CHECK-NEXT: "end": { +// CHECK-NEXT: "col": 1, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 15 +// CHECK-NEXT: } +// CHECK-NEXT: }, +// CHECK-NEXT: "name": "baz", +// CHECK-NEXT: "inner": [ +// CHECK-NEXT: { +// CHECK-NEXT: "id": "0x{{.*}}", +// CHECK-NEXT: "kind": "NamespaceDecl", +// CHECK-NEXT: "loc": { // CHECK-NEXT: "col": 16, // CHECK-NEXT: "file": "{{.*}}", -// CHECK-NEXT: "line": 118 -// CHECK-NEXT: }, -// CHECK-NEXT: "range": { +// CHECK-NEXT: "line": 14 +// CHECK-NEXT: }, +// CHECK-NEXT: "range": { // CHECK-NEXT: "begin": { -// CHECK-NEXT: "col": 14, -// CHECK-NEXT: "file": "{{.*}}", -// CHECK-NEXT: "line": 118 +// CHECK-NEXT: "col": 14, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 14 // CHECK-NEXT: }, // CHECK-NEXT: "end": { -// CHECK-NEXT: "col": 1, -// CHECK-NEXT: "file": "{{.*}}", -// CHECK-NEXT: "line": 119 +// CHECK-NEXT: "col": 1, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 15 // CHECK-NEXT: } -// CHECK-NEXT: }, -// CHECK-NEXT: "name": "quux" +// CHECK-NEXT: }, +// CHECK-NEXT: "name": "quux" +// CHECK-NEXT: } +// CHECK-NEXT: ] // CHECK-NEXT: } -// CHECK-NEXT: ] -// CHECK-NEXT: }, -namespace quux::inline frobble { -} -// CHECK: "kind": "NamespaceDecl", -// CHECK-NEXT: "loc": { -// CHECK-NEXT: "col": 11, -// CHECK-NEXT: "file": "{{.*}}", -// CHECK-NEXT: "line": 165 -// CHECK-NEXT: }, -// CHECK-NEXT: "range": { -// CHECK-NEXT: "begin": { -// CHECK-NEXT: "col": 1, -// CHECK-NEXT: "file": "{{.*}}", -// CHECK-NEXT: "line": 165 -// CHECK-NEXT: }, -// CHECK-NEXT: "end": { -// CHECK-NEXT: "col": 1, -// CHECK-NEXT: "file": "{{.*}}", -// CHECK-NEXT: "line": 166 -// CHECK-NEXT: } -// CHECK-NEXT: }, -// CHECK-NEXT: "name": "quux", -// CHECK-NEXT: "inner": [ -// CHECK-NEXT: { -// CHECK-NEXT: "id": "0x{{.*}}", -// CHECK-NEXT: "kind": "NamespaceDecl", -// CHECK-NEXT: "loc": { + +// CHECK: "kind": "NamespaceDecl", +// CHECK-NEXT: "loc": { +// CHECK-NEXT: "col": 11, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 17 +// CHECK-NEXT: }, +// CHECK-NEXT: "range": { +// CHECK-NEXT: "begin": { +// CHECK-NEXT: "col": 1, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 17 +// CHECK-NEXT: }, +// CHECK-NEXT: "end": { +// CHECK-NEXT: "col": 1, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 18 +// CHECK-NEXT: } +// CHECK-NEXT: }, +// CHECK-NEXT: "name": "quux", +// CHECK-NEXT: "inner": [ +// CHECK-NEXT: { +// CHECK-NEXT: "id": "0x{{.*}}", +// CHECK-NEXT: "kind": "NamespaceDecl", +// CHECK-NEXT: "loc": { // CHECK-NEXT: "col": 24, // CHECK-NEXT: "file": "{{.*}}", -// CHECK-NEXT: "line": 165 -// CHECK-NEXT: }, -// CHECK-NEXT: "range": { +// CHECK-NEXT: "line": 17 +// CHECK-NEXT: }, +// CHECK-NEXT: "range": { // CHECK-NEXT: "begin": { -// CHECK-NEXT: "col": 17, -// CHECK-NEXT: "file": "{{.*}}", -// CHECK-NEXT: "line": 165 +// CHECK-NEXT: "col": 17, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 17 // CHECK-NEXT: }, // CHECK-NEXT: "end": { -// CHECK-NEXT: "col": 1, -// CHECK-NEXT: "file": "{{.*}}", -// CHECK-NEXT: "line": 166 +// CHECK-NEXT: "col": 1, +// CHECK-NEXT: "file": "{{.*}}", +// CHECK-NEXT: "line": 18 // CHECK-NEXT: } -// CHECK-NEXT: }, -// CHECK-NEXT: "name": "frobble", -// CHECK-NEXT: "isInline": true -// CHECK-NEXT: } -// CHECK-NEXT: ] +// CHECK-NEXT: }, +// CHECK-NEXT: "name": "frobble", +// CHECK-NEXT: "isInline": true +// CHECK-NEXT: } +// CHECK-NEXT: ] // CHECK-NEXT: } diff --git a/test/AST/ast-dump-record-definition-data-json.cpp b/test/AST/ast-dump-record-definition-data-json.cpp index 11c44f9829..de2fb86e70 100644 --- a/test/AST/ast-dump-record-definition-data-json.cpp +++ b/test/AST/ast-dump-record-definition-data-json.cpp @@ -124,6 +124,9 @@ struct DoesNotAllowConstDefaultInit { int i; }; +// NOTE: CHECK lines have been autogenerated by gen_ast_dump_json_test.py +// using --filters=CXXRecordDecl + // CHECK: "kind": "CXXRecordDecl", // CHECK-NEXT: "name": "__NSConstantString_tag" diff --git a/test/AST/ast-dump-records-json.cpp b/test/AST/ast-dump-records-json.cpp index 05f1f9218c..3b33d38366 100644 --- a/test/AST/ast-dump-records-json.cpp +++ b/test/AST/ast-dump-records-json.cpp @@ -84,6 +84,9 @@ template struct Derived6 : virtual public Bases... { }; +// NOTE: CHECK lines have been autogenerated by gen_ast_dump_json_test.py +// using --filters=CXXRecordDecl + // CHECK: "kind": "CXXRecordDecl", // CHECK-NEXT: "name": "__NSConstantString_tag" diff --git a/test/AST/ast-dump-stmt-json.c b/test/AST/ast-dump-stmt-json.c index b93363ecb2..f86743a84a 100644 --- a/test/AST/ast-dump-stmt-json.c +++ b/test/AST/ast-dump-stmt-json.c @@ -133,6 +133,8 @@ void TestMiscStmts(void) { ({int a = 10; a;}); } +// NOTE: CHECK lines have been autogenerated by gen_ast_dump_json_test.py +// using --filters=VarDecl,CompoundStmt // CHECK: "kind": "VarDecl", @@ -5096,4 +5098,3 @@ void TestMiscStmts(void) { // CHECK-NEXT: } // CHECK-NEXT: ] // CHECK-NEXT: } - diff --git a/test/AST/ast-dump-stmt-json.cpp b/test/AST/ast-dump-stmt-json.cpp index 5ca3cecfcd..576c333175 100644 --- a/test/AST/ast-dump-stmt-json.cpp +++ b/test/AST/ast-dump-stmt-json.cpp @@ -122,6 +122,9 @@ void TestDependentGenericSelectionExpr(Ty T) { _Generic(T, default : 0); } +// NOTE: CHECK lines have been autogenerated by gen_ast_dump_json_test.py +// using --filters=FunctionDecl,FunctionTemplateDecl,UsingDecl,UsingShadowDecl + // CHECK: "kind": "FunctionDecl", // CHECK-NEXT: "loc": { diff --git a/test/AST/ast-dump-stmt-json.m b/test/AST/ast-dump-stmt-json.m index 9647f4a78c..be9a6b60ec 100644 --- a/test/AST/ast-dump-stmt-json.m +++ b/test/AST/ast-dump-stmt-json.m @@ -19,6 +19,8 @@ void TestObjCAtCatchStmt() { } } +// NOTE: CHECK lines have been autogenerated by gen_ast_dump_json_test.py + // CHECK: "kind": "FunctionDecl", // CHECK-NEXT: "loc": { diff --git a/test/AST/ast-dump-template-decls-json.cpp b/test/AST/ast-dump-template-decls-json.cpp index 31f400f15e..cce9ef7216 100644 --- a/test/AST/ast-dump-template-decls-json.cpp +++ b/test/AST/ast-dump-template-decls-json.cpp @@ -55,6 +55,8 @@ template template void V::f() {} +// NOTE: CHECK lines have been autogenerated by gen_ast_dump_json_test.py + // CHECK: "kind": "TranslationUnitDecl", // CHECK-NEXT: "loc": {}, diff --git a/test/AST/ast-dump-temporaries-json.cpp b/test/AST/ast-dump-temporaries-json.cpp index dbd6f29fd0..15fd491124 100644 --- a/test/AST/ast-dump-temporaries-json.cpp +++ b/test/AST/ast-dump-temporaries-json.cpp @@ -18,6 +18,8 @@ void MaterializeTemp() { func(f); } +// NOTE: CHECK lines have been autogenerated by gen_ast_dump_json_test.py +// using --filters=ExprWithCleanups // CHECK: "kind": "ExprWithCleanups", @@ -443,4 +445,3 @@ void MaterializeTemp() { // CHECK-NEXT: } // CHECK-NEXT: ] // CHECK-NEXT: } - diff --git a/test/AST/gen_ast_dump_json_test.py b/test/AST/gen_ast_dump_json_test.py index a7b98776de..975039ead2 100644 --- a/test/AST/gen_ast_dump_json_test.py +++ b/test/AST/gen_ast_dump_json_test.py @@ -78,6 +78,12 @@ def main(): options = args.opts.split(' ') filters = Set(args.filters.split(',')) if args.filters else Set([]) + note = "// NOTE: CHECK lines have been autogenerated by " \ + "gen_ast_dump_json_test.py" + + if (args.filters): + note += "\n// using --filters=" + args.filters + cmd = [clang_binary, "-cc1"] cmd.extend(options) @@ -118,6 +124,7 @@ def main(): print("Writing json appended source file to %s." %(dest_path)) copyfile(args.source, dest_path) with open(dest_path, "a") as f: + f.write("\n" + note + "\n") for out_ast in out_asts: append_str = json.dumps(out_ast, indent=1, ensure_ascii=False) out_str = '\n\n' diff --git a/test/AST/multistep-explicit-cast-json.c b/test/AST/multistep-explicit-cast-json.c index 3728fd5d2b..f13f49c9f3 100644 --- a/test/AST/multistep-explicit-cast-json.c +++ b/test/AST/multistep-explicit-cast-json.c @@ -34,6 +34,9 @@ signed char cstylecast_3(signed int x) { return (signed char)x; } +// NOTE: CHECK lines have been autogenerated by gen_ast_dump_json_test.py +// using --filters=ImplicitCastExpr,CStyleCastExpr + // CHECK: "kind": "ImplicitCastExpr", // CHECK-NEXT: "range": { @@ -629,4 +632,3 @@ signed char cstylecast_3(signed int x) { // CHECK-NEXT: } // CHECK-NEXT: ] // CHECK-NEXT: } - diff --git a/test/AST/multistep-explicit-cast-json.cpp b/test/AST/multistep-explicit-cast-json.cpp index 4ca70074fb..70ba2f2cd9 100644 --- a/test/AST/multistep-explicit-cast-json.cpp +++ b/test/AST/multistep-explicit-cast-json.cpp @@ -75,6 +75,9 @@ SignedChar cxxfunctionalcast_3(SignedInt x) { return SignedChar(x); } +// NOTE: CHECK lines have been autogenerated by gen_ast_dump_json_test.py +// using --filters=ImplicitCastExpr,CStyleCastExpr,CXXStaticCastExpr,CXXFunctionalCastExpr + // CHECK: "kind": "ImplicitCastExpr", // CHECK-NEXT: "range": { @@ -1578,4 +1581,3 @@ SignedChar cxxfunctionalcast_3(SignedInt x) { // CHECK-NEXT: } // CHECK-NEXT: ] // CHECK-NEXT: } - -- 2.40.0