2019-05-21 00:46:44 +08:00
|
|
|
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -ast-dump=json %s | FileCheck %s
|
|
|
|
|
|
|
|
#define FOO frobble
|
|
|
|
#define BAR FOO
|
|
|
|
|
|
|
|
void FOO(void);
|
|
|
|
void BAR(void);
|
|
|
|
|
|
|
|
#define BING(x) x
|
|
|
|
|
|
|
|
void BING(quux)(void);
|
|
|
|
|
|
|
|
#define BLIP(x, y) x ## y
|
|
|
|
#define BLAP(x, y) BLIP(x, y)
|
|
|
|
|
|
|
|
void BLAP(foo, __COUNTER__)(void);
|
|
|
|
void BLAP(foo, __COUNTER__)(void);
|
|
|
|
|
2019-06-21 22:37:39 +08:00
|
|
|
// NOTE: CHECK lines have been autogenerated by gen_ast_dump_json_test.py
|
|
|
|
// using --filters=FunctionDecl
|
|
|
|
|
2019-05-21 00:46:44 +08:00
|
|
|
|
|
|
|
// CHECK: "kind": "FunctionDecl",
|
|
|
|
// CHECK-NEXT: "loc": {
|
|
|
|
// CHECK-NEXT: "spellingLoc": {
|
|
|
|
// CHECK-NEXT: "file": "{{.*}}",
|
2019-06-25 04:07:11 +08:00
|
|
|
// CHECK-NEXT: "line": 3,
|
|
|
|
// CHECK-NEXT: "col": 13,
|
|
|
|
// CHECK-NEXT: "tokLen": 7
|
|
|
|
// CHECK-NEXT: },
|
|
|
|
// CHECK-NEXT: "expansionLoc": {
|
|
|
|
// CHECK-NEXT: "line": 6,
|
|
|
|
// CHECK-NEXT: "col": 6,
|
|
|
|
// CHECK-NEXT: "tokLen": 3
|
2019-05-21 00:46:44 +08:00
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: },
|
|
|
|
// CHECK-NEXT: "range": {
|
|
|
|
// CHECK-NEXT: "begin": {
|
|
|
|
// CHECK-NEXT: "col": 1,
|
2019-06-25 04:07:11 +08:00
|
|
|
// CHECK-NEXT: "tokLen": 4
|
2019-05-21 00:46:44 +08:00
|
|
|
// CHECK-NEXT: },
|
|
|
|
// CHECK-NEXT: "end": {
|
|
|
|
// CHECK-NEXT: "col": 14,
|
2019-06-25 04:07:11 +08:00
|
|
|
// CHECK-NEXT: "tokLen": 1
|
2019-05-21 00:46:44 +08:00
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: },
|
|
|
|
// CHECK-NEXT: "name": "frobble",
|
|
|
|
// CHECK-NEXT: "type": {
|
|
|
|
// CHECK-NEXT: "qualType": "void (void)"
|
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: }
|
|
|
|
|
|
|
|
|
|
|
|
// CHECK: "kind": "FunctionDecl",
|
|
|
|
// CHECK-NEXT: "loc": {
|
|
|
|
// CHECK-NEXT: "spellingLoc": {
|
2019-06-25 04:07:11 +08:00
|
|
|
// CHECK-NEXT: "line": 3,
|
2019-05-21 00:46:44 +08:00
|
|
|
// CHECK-NEXT: "col": 13,
|
2019-06-25 04:07:11 +08:00
|
|
|
// CHECK-NEXT: "tokLen": 7
|
|
|
|
// CHECK-NEXT: },
|
|
|
|
// CHECK-NEXT: "expansionLoc": {
|
|
|
|
// CHECK-NEXT: "line": 7,
|
|
|
|
// CHECK-NEXT: "col": 6,
|
|
|
|
// CHECK-NEXT: "tokLen": 3
|
2019-05-21 00:46:44 +08:00
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: },
|
|
|
|
// CHECK-NEXT: "range": {
|
|
|
|
// CHECK-NEXT: "begin": {
|
|
|
|
// CHECK-NEXT: "col": 1,
|
2019-06-25 04:07:11 +08:00
|
|
|
// CHECK-NEXT: "tokLen": 4
|
2019-05-21 00:46:44 +08:00
|
|
|
// CHECK-NEXT: },
|
|
|
|
// CHECK-NEXT: "end": {
|
|
|
|
// CHECK-NEXT: "col": 14,
|
2019-06-25 04:07:11 +08:00
|
|
|
// CHECK-NEXT: "tokLen": 1
|
2019-05-21 00:46:44 +08:00
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: },
|
|
|
|
// CHECK-NEXT: "previousDecl": "0x{{.*}}",
|
|
|
|
// CHECK-NEXT: "name": "frobble",
|
|
|
|
// CHECK-NEXT: "type": {
|
|
|
|
// CHECK-NEXT: "qualType": "void (void)"
|
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: }
|
|
|
|
|
|
|
|
|
|
|
|
// CHECK: "kind": "FunctionDecl",
|
|
|
|
// CHECK-NEXT: "loc": {
|
|
|
|
// CHECK-NEXT: "spellingLoc": {
|
2019-06-25 04:07:11 +08:00
|
|
|
// CHECK-NEXT: "line": 11,
|
2019-05-21 00:46:44 +08:00
|
|
|
// CHECK-NEXT: "col": 11,
|
2019-06-25 04:07:11 +08:00
|
|
|
// CHECK-NEXT: "tokLen": 4
|
|
|
|
// CHECK-NEXT: },
|
|
|
|
// CHECK-NEXT: "expansionLoc": {
|
|
|
|
// CHECK-NEXT: "col": 6,
|
|
|
|
// CHECK-NEXT: "tokLen": 4,
|
|
|
|
// CHECK-NEXT: "isMacroArgExpansion": true
|
2019-05-21 00:46:44 +08:00
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: },
|
|
|
|
// CHECK-NEXT: "range": {
|
|
|
|
// CHECK-NEXT: "begin": {
|
|
|
|
// CHECK-NEXT: "col": 1,
|
2019-06-25 04:07:11 +08:00
|
|
|
// CHECK-NEXT: "tokLen": 4
|
2019-05-21 00:46:44 +08:00
|
|
|
// CHECK-NEXT: },
|
|
|
|
// CHECK-NEXT: "end": {
|
|
|
|
// CHECK-NEXT: "col": 21,
|
2019-06-25 04:07:11 +08:00
|
|
|
// CHECK-NEXT: "tokLen": 1
|
2019-05-21 00:46:44 +08:00
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: },
|
|
|
|
// CHECK-NEXT: "name": "quux",
|
|
|
|
// CHECK-NEXT: "type": {
|
|
|
|
// CHECK-NEXT: "qualType": "void (void)"
|
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: }
|
|
|
|
|
|
|
|
|
|
|
|
// CHECK: "kind": "FunctionDecl",
|
|
|
|
// CHECK-NEXT: "loc": {
|
|
|
|
// CHECK-NEXT: "spellingLoc": {
|
|
|
|
// CHECK-NEXT: "file": "<scratch space>",
|
2019-06-25 04:07:11 +08:00
|
|
|
// CHECK-NEXT: "line": 3,
|
|
|
|
// CHECK-NEXT: "col": 1,
|
|
|
|
// CHECK-NEXT: "tokLen": 4
|
|
|
|
// CHECK-NEXT: },
|
|
|
|
// CHECK-NEXT: "expansionLoc": {
|
|
|
|
// CHECK-NEXT: "file": "{{.*}}",
|
|
|
|
// CHECK-NEXT: "line": 16,
|
|
|
|
// CHECK-NEXT: "col": 6,
|
|
|
|
// CHECK-NEXT: "tokLen": 4
|
2019-05-21 00:46:44 +08:00
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: },
|
|
|
|
// CHECK-NEXT: "range": {
|
|
|
|
// CHECK-NEXT: "begin": {
|
|
|
|
// CHECK-NEXT: "col": 1,
|
2019-06-25 04:07:11 +08:00
|
|
|
// CHECK-NEXT: "tokLen": 4
|
2019-05-21 00:46:44 +08:00
|
|
|
// CHECK-NEXT: },
|
|
|
|
// CHECK-NEXT: "end": {
|
|
|
|
// CHECK-NEXT: "col": 33,
|
2019-06-25 04:07:11 +08:00
|
|
|
// CHECK-NEXT: "tokLen": 1
|
2019-05-21 00:46:44 +08:00
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: },
|
|
|
|
// CHECK-NEXT: "name": "foo0",
|
|
|
|
// CHECK-NEXT: "type": {
|
|
|
|
// CHECK-NEXT: "qualType": "void (void)"
|
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: }
|
|
|
|
|
|
|
|
|
|
|
|
// CHECK: "kind": "FunctionDecl",
|
|
|
|
// CHECK-NEXT: "loc": {
|
|
|
|
// CHECK-NEXT: "spellingLoc": {
|
|
|
|
// CHECK-NEXT: "file": "<scratch space>",
|
2019-06-25 04:07:11 +08:00
|
|
|
// CHECK-NEXT: "line": 5,
|
|
|
|
// CHECK-NEXT: "col": 1,
|
|
|
|
// CHECK-NEXT: "tokLen": 4
|
|
|
|
// CHECK-NEXT: },
|
|
|
|
// CHECK-NEXT: "expansionLoc": {
|
|
|
|
// CHECK-NEXT: "file": "{{.*}}",
|
|
|
|
// CHECK-NEXT: "line": 17,
|
|
|
|
// CHECK-NEXT: "col": 6,
|
|
|
|
// CHECK-NEXT: "tokLen": 4
|
2019-05-21 00:46:44 +08:00
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: },
|
|
|
|
// CHECK-NEXT: "range": {
|
|
|
|
// CHECK-NEXT: "begin": {
|
|
|
|
// CHECK-NEXT: "col": 1,
|
2019-06-25 04:07:11 +08:00
|
|
|
// CHECK-NEXT: "tokLen": 4
|
2019-05-21 00:46:44 +08:00
|
|
|
// CHECK-NEXT: },
|
|
|
|
// CHECK-NEXT: "end": {
|
|
|
|
// CHECK-NEXT: "col": 33,
|
2019-06-25 04:07:11 +08:00
|
|
|
// CHECK-NEXT: "tokLen": 1
|
2019-05-21 00:46:44 +08:00
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: },
|
|
|
|
// CHECK-NEXT: "name": "foo1",
|
|
|
|
// CHECK-NEXT: "type": {
|
|
|
|
// CHECK-NEXT: "qualType": "void (void)"
|
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: }
|