annotate-tokens-pp.c revision bf7efa2742dc94363d3561d284c9d634fc5a780f
19c7779b64eacf264ee427b97ae0df8596b1960ccbart#define NOTHING(X,Y) 29c7779b64eacf264ee427b97ae0df8596b1960ccbart#define STILL_NOTHING NOTHING(honk,warble) 39c7779b64eacf264ee427b97ae0df8596b1960ccbart#define BAR baz 49c7779b64eacf264ee427b97ae0df8596b1960ccbart#define WIBBLE(X, Y) X##Y 5f2a68aa6deb788304b9c100ecd4dec41f5064b8cphilippeNOTHING(more,junk) float WIBBLE(int, float); 69c7779b64eacf264ee427b97ae0df8596b1960ccbartint BAR STILL_NOTHING; 79c7779b64eacf264ee427b97ae0df8596b1960ccbart#include "foo.h" 89c7779b64eacf264ee427b97ae0df8596b1960ccbart#undef BAR 99c7779b64eacf264ee427b97ae0df8596b1960ccbart 109c7779b64eacf264ee427b97ae0df8596b1960ccbart// RUN: c-index-test -test-annotate-tokens=%s:2:1:9:1 -I%S/Inputs %s | FileCheck %s 119c7779b64eacf264ee427b97ae0df8596b1960ccbart// CHECK: Punctuation: "#" [2:1 - 2:2] preprocessing directive= 129c7779b64eacf264ee427b97ae0df8596b1960ccbart// CHECK: Identifier: "define" [2:2 - 2:8] preprocessing directive= 139c7779b64eacf264ee427b97ae0df8596b1960ccbart// CHECK: Identifier: "STILL_NOTHING" [2:9 - 2:22] macro definition=STILL_NOTHING 149c7779b64eacf264ee427b97ae0df8596b1960ccbart// CHECK: Identifier: "NOTHING" [2:23 - 2:30] preprocessing directive= 159c7779b64eacf264ee427b97ae0df8596b1960ccbart// CHECK: Punctuation: "(" [2:30 - 2:31] preprocessing directive= 169c7779b64eacf264ee427b97ae0df8596b1960ccbart// CHECK: Identifier: "honk" [2:31 - 2:35] preprocessing directive= 179c7779b64eacf264ee427b97ae0df8596b1960ccbart// CHECK: Punctuation: "," [2:35 - 2:36] preprocessing directive= 189c7779b64eacf264ee427b97ae0df8596b1960ccbart// CHECK: Identifier: "warble" [2:36 - 2:42] preprocessing directive= 199c7779b64eacf264ee427b97ae0df8596b1960ccbart// CHECK: Punctuation: ")" [2:42 - 2:43] preprocessing directive= 209c7779b64eacf264ee427b97ae0df8596b1960ccbart// CHECK: Punctuation: "#" [3:1 - 3:2] preprocessing directive= 219c7779b64eacf264ee427b97ae0df8596b1960ccbart// CHECK: Identifier: "define" [3:2 - 3:8] preprocessing directive= 229c7779b64eacf264ee427b97ae0df8596b1960ccbart// CHECK: Identifier: "BAR" [3:9 - 3:12] macro definition=BAR 239c7779b64eacf264ee427b97ae0df8596b1960ccbart// CHECK: Identifier: "baz" [3:13 - 3:16] preprocessing directive= 249c7779b64eacf264ee427b97ae0df8596b1960ccbart// CHECK: Punctuation: "#" [4:1 - 4:2] preprocessing directive= 259c7779b64eacf264ee427b97ae0df8596b1960ccbart// CHECK: Identifier: "define" [4:2 - 4:8] preprocessing directive= 269c7779b64eacf264ee427b97ae0df8596b1960ccbart// CHECK: Identifier: "WIBBLE" [4:9 - 4:15] macro definition=WIBBLE 279c7779b64eacf264ee427b97ae0df8596b1960ccbart// CHECK: Punctuation: "(" [4:15 - 4:16] preprocessing directive= 289c7779b64eacf264ee427b97ae0df8596b1960ccbart// CHECK: Identifier: "X" [4:16 - 4:17] preprocessing directive= 299c7779b64eacf264ee427b97ae0df8596b1960ccbart// CHECK: Punctuation: "," [4:17 - 4:18] preprocessing directive= 309c7779b64eacf264ee427b97ae0df8596b1960ccbart// CHECK: Identifier: "Y" [4:19 - 4:20] preprocessing directive= 319c7779b64eacf264ee427b97ae0df8596b1960ccbart// CHECK: Punctuation: ")" [4:20 - 4:21] preprocessing directive= 329c7779b64eacf264ee427b97ae0df8596b1960ccbart// CHECK: Identifier: "X" [4:22 - 4:23] preprocessing directive= 339c7779b64eacf264ee427b97ae0df8596b1960ccbart// CHECK: Punctuation: "##" [4:23 - 4:25] preprocessing directive= 349c7779b64eacf264ee427b97ae0df8596b1960ccbart// CHECK: Identifier: "Y" [4:25 - 4:26] preprocessing directive= 359c7779b64eacf264ee427b97ae0df8596b1960ccbart// CHECK: Identifier: "NOTHING" [5:1 - 5:8] macro instantiation=NOTHING:1:9 369c7779b64eacf264ee427b97ae0df8596b1960ccbart// CHECK: Punctuation: "(" [5:8 - 5:9] 379c7779b64eacf264ee427b97ae0df8596b1960ccbart// CHECK: Identifier: "more" [5:9 - 5:13] 389c7779b64eacf264ee427b97ae0df8596b1960ccbart// CHECK: Punctuation: "," [5:13 - 5:14] 399c7779b64eacf264ee427b97ae0df8596b1960ccbart// CHECK: Identifier: "junk" [5:14 - 5:18] 409c7779b64eacf264ee427b97ae0df8596b1960ccbart// CHECK: Punctuation: ")" [5:18 - 5:19] 419c7779b64eacf264ee427b97ae0df8596b1960ccbart// CHECK: Keyword: "float" [5:20 - 5:25] 429c7779b64eacf264ee427b97ae0df8596b1960ccbart// CHECK: Identifier: "WIBBLE" [5:26 - 5:32] macro instantiation=WIBBLE:4:9 439c7779b64eacf264ee427b97ae0df8596b1960ccbart// CHECK: Punctuation: "(" [5:32 - 5:33] 449c7779b64eacf264ee427b97ae0df8596b1960ccbart// CHECK: Keyword: "int" [5:33 - 5:36] 459c7779b64eacf264ee427b97ae0df8596b1960ccbart// CHECK: Punctuation: "," [5:36 - 5:37] 469c7779b64eacf264ee427b97ae0df8596b1960ccbart// CHECK: Keyword: "float" [5:38 - 5:43] 479c7779b64eacf264ee427b97ae0df8596b1960ccbart// CHECK: Punctuation: ")" [5:43 - 5:44] 489c7779b64eacf264ee427b97ae0df8596b1960ccbart// CHECK: Punctuation: ";" [5:44 - 5:45] 499c7779b64eacf264ee427b97ae0df8596b1960ccbart// CHECK: Keyword: "int" [6:1 - 6:4] 509c7779b64eacf264ee427b97ae0df8596b1960ccbart// CHECK: Identifier: "BAR" [6:5 - 6:8] macro instantiation=BAR:3:9 519c7779b64eacf264ee427b97ae0df8596b1960ccbart// CHECK: Identifier: "STILL_NOTHING" [6:9 - 6:22] macro instantiation=STILL_NOTHING:2:9 529c7779b64eacf264ee427b97ae0df8596b1960ccbart// CHECK: Punctuation: ";" [6:22 - 6:23] 539c7779b64eacf264ee427b97ae0df8596b1960ccbart// CHECK: Punctuation: "#" [7:1 - 7:2] preprocessing directive= 549c7779b64eacf264ee427b97ae0df8596b1960ccbart// CHECK: Identifier: "include" [7:2 - 7:9] preprocessing directive= 559c7779b64eacf264ee427b97ae0df8596b1960ccbart// CHECK: Literal: ""foo.h"" [7:10 - 7:17] preprocessing directive= 569c7779b64eacf264ee427b97ae0df8596b1960ccbart// CHECK: Punctuation: "#" [8:1 - 8:2] preprocessing directive= 579c7779b64eacf264ee427b97ae0df8596b1960ccbart// CHECK: Identifier: "undef" [8:2 - 8:7] preprocessing directive= 589c7779b64eacf264ee427b97ae0df8596b1960ccbart// CHECK: Identifier: "BAR" [8:8 - 8:11] preprocessing directive= 599c7779b64eacf264ee427b97ae0df8596b1960ccbart