blob: 8f986912cd6bab997b29c3b8aca70f986f0a4868 [file] [log] [blame]
Douglas Gregor0396f462010-03-19 05:22:59 +00001#define OBSCURE(X) X
2#define DECORATION
3
4typedef int T;
5void OBSCURE(func)(int x) {
6 OBSCURE(T) DECORATION value;
7}
8
Douglas Gregord93fae62010-10-21 20:55:34 +00009#include "a.h"
10
Douglas Gregor85fe1562010-12-10 07:23:11 +000011#define A(X) X
12#define B(X) A(X)
13
14B(int x);
15
Douglas Gregord93fae62010-10-21 20:55:34 +000016// RUN: c-index-test -cursor-at=%s:1:11 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-1 %s
Douglas Gregor0396f462010-03-19 05:22:59 +000017// CHECK-1: macro definition=OBSCURE
Douglas Gregord93fae62010-10-21 20:55:34 +000018// RUN: c-index-test -cursor-at=%s:2:14 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-2 %s
Douglas Gregor0396f462010-03-19 05:22:59 +000019// CHECK-2: macro definition=DECORATION
Douglas Gregord93fae62010-10-21 20:55:34 +000020// RUN: c-index-test -cursor-at=%s:5:7 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-3 %s
Douglas Gregor0396f462010-03-19 05:22:59 +000021// CHECK-3: macro instantiation=OBSCURE:1:9
Douglas Gregord93fae62010-10-21 20:55:34 +000022// RUN: c-index-test -cursor-at=%s:6:6 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-4 %s
Douglas Gregor0396f462010-03-19 05:22:59 +000023// CHECK-4: macro instantiation=OBSCURE:1:9
Douglas Gregord93fae62010-10-21 20:55:34 +000024// RUN: c-index-test -cursor-at=%s:6:19 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-5 %s
Douglas Gregor0396f462010-03-19 05:22:59 +000025// CHECK-5: macro instantiation=DECORATION:2:9
Douglas Gregord93fae62010-10-21 20:55:34 +000026// 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
Douglas Gregor85fe1562010-12-10 07:23:11 +000028// RUN: c-index-test -cursor-at=%s:14:1 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-7 %s
29// CHECK-7: macro instantiation=B:12:9
Douglas Gregor89d99802010-11-30 06:16:57 +000030
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