1 #define OBSCURE(X) X
2 #define DECORATION
3
4 typedef int T;
OBSCURE(func)5 void OBSCURE(func)(int x) {
6 OBSCURE(T) DECORATION value;
7 }
8
9 #include "a.h"
10
11 #define A(X) X
12 #define B(X) A(X)
13
14 B(int x);
15
16 // RUN: c-index-test -cursor-at=%s:1:11 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-1 %s
17 // CHECK-1: macro definition=OBSCURE
18 // RUN: c-index-test -cursor-at=%s:2:14 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-2 %s
19 // CHECK-2: macro definition=DECORATION
20 // RUN: c-index-test -cursor-at=%s:5:7 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-3 %s
21 // CHECK-3: macro expansion=OBSCURE:1:9
22 // RUN: c-index-test -cursor-at=%s:6:6 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-4 %s
23 // CHECK-4: macro expansion=OBSCURE:1:9
24 // RUN: c-index-test -cursor-at=%s:6:19 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-5 %s
25 // CHECK-5: macro expansion=DECORATION:2:9
26 // RUN: c-index-test -cursor-at=%s:9:10 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-6 %s
27 // CHECK-6: inclusion directive=a.h
28 // RUN: c-index-test -cursor-at=%s:14:1 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-7 %s
29 // CHECK-7: macro expansion=B:12:9
30
31 // Same tests, but with "editing" optimizations
32 // RUN: env CINDEXTEST_EDITING=1 c-index-test -cursor-at=%s:1:11 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-1 %s
33 // RUN: env CINDEXTEST_EDITING=1 c-index-test -cursor-at=%s:2:14 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-2 %s
34 // RUN: env CINDEXTEST_EDITING=1 c-index-test -cursor-at=%s:5:7 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-3 %s
35 // RUN: env CINDEXTEST_EDITING=1 c-index-test -cursor-at=%s:9:10 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-6 %s
36