blob: 26a63b151b7b8a9672893252f8ef2ddf7b2d19d2 [file] [log] [blame]
Douglas Gregor09d9fa12010-04-05 16:10:30 +00001// Note: the run lines follow their respective tests, since line/column
2// matter in this test.
3
4#define FOO(Arg1,Arg2) foobar
Douglas Gregor590c7d52010-07-08 20:55:51 +00005#define nil 0
Douglas Gregor09d9fa12010-04-05 16:10:30 +00006void f() {
7
8}
9
Douglas Gregor590c7d52010-07-08 20:55:51 +000010void g(int);
11
12void f2() {
13 int *ip = nil;
14 ip = nil;
15 g(nil);
16}
17
Douglas Gregor09d9fa12010-04-05 16:10:30 +000018// RUN: c-index-test -code-completion-at=%s:7:1 %s | FileCheck -check-prefix=CHECK-CC1 %s
Douglas Gregor87c08a52010-08-13 22:48:40 +000019// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:7:1 %s | FileCheck -check-prefix=CHECK-CC1 %s
Douglas Gregor09d9fa12010-04-05 16:10:30 +000020// CHECK-CC1: macro definition:{TypedText FOO}{LeftParen (}{Placeholder Arg1}{Comma , }{Placeholder Arg2}{RightParen )}
Douglas Gregor590c7d52010-07-08 20:55:51 +000021// RUN: c-index-test -code-completion-at=%s:13:13 %s | FileCheck -check-prefix=CHECK-CC2 %s
22// RUN: c-index-test -code-completion-at=%s:14:8 %s | FileCheck -check-prefix=CHECK-CC2 %s
Douglas Gregor1827e102010-08-16 16:18:59 +000023// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:14:8 %s | FileCheck -check-prefix=CHECK-CC2 %s
Douglas Gregor590c7d52010-07-08 20:55:51 +000024// CHECK-CC2: macro definition:{TypedText nil} (30)
25// RUN: c-index-test -code-completion-at=%s:15:5 %s | FileCheck -check-prefix=CHECK-CC3 %s
Douglas Gregor1827e102010-08-16 16:18:59 +000026// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:15:5 %s | FileCheck -check-prefix=CHECK-CC3 %s
Douglas Gregor590c7d52010-07-08 20:55:51 +000027// CHECK-CC3: macro definition:{TypedText nil} (60)