blob: 2393965c2837cd634ad9674c745a3013d3f5a1f1 [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
11// 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 +000012// CHECK-1: macro definition=OBSCURE
Douglas Gregord93fae62010-10-21 20:55:34 +000013// 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 +000014// CHECK-2: macro definition=DECORATION
Douglas Gregord93fae62010-10-21 20:55:34 +000015// 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 +000016// CHECK-3: macro instantiation=OBSCURE:1:9
Douglas Gregord93fae62010-10-21 20:55:34 +000017// 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 +000018// CHECK-4: macro instantiation=OBSCURE:1:9
Douglas Gregord93fae62010-10-21 20:55:34 +000019// 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 +000020// CHECK-5: macro instantiation=DECORATION:2:9
Douglas Gregord93fae62010-10-21 20:55:34 +000021// RUN: c-index-test -cursor-at=%s:9:10 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-6 %s
22// CHECK-6: inclusion directive=a.h
Douglas Gregor89d99802010-11-30 06:16:57 +000023
24// Same tests, but with "editing" optimizations
25// RUN: env CINDEXTEST_EDITING=1 c-index-test -cursor-at=%s:1:11 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-1 %s
26// RUN: env CINDEXTEST_EDITING=1 c-index-test -cursor-at=%s:2:14 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-2 %s
27// RUN: env CINDEXTEST_EDITING=1 c-index-test -cursor-at=%s:5:7 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-3 %s
28// RUN: env CINDEXTEST_EDITING=1 c-index-test -cursor-at=%s:9:10 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-6 %s