blob: 5eead7e1fde1532bac65ca06590569e47db8af89 [file] [log] [blame]
Douglas Gregor64538cf2010-04-06 15:09:27 +00001// Note: the run lines follow their respective tests, since line/column
2// matter in this test.
3
4int f(int);
5
6int test(int i, int j, int k, int l) {
7 return i | j | k & l;
8}
9
Douglas Gregorbd6c76f2010-05-30 22:23:08 +000010struct X f1 = { 17 };
11void f2() { f1(17); }
12
Douglas Gregor33611e02010-05-30 22:59:50 +000013const char *str = "Hello, \nWorld";
14
Douglas Gregord8e8a582010-05-25 21:41:55 +000015// RUN: c-index-test -code-completion-at=%s:7:9 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC1 %s
Douglas Gregor1abc6bc2010-08-04 16:47:14 +000016// RUN: env CINDEXTEST_EDITING=1 c-index-test -code-completion-at=%s:7:9 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC1 %s
Douglas Gregor12e13132010-05-26 22:00:08 +000017// CHECK-CC1: macro definition:{TypedText __VERSION__} (70)
Douglas Gregor5ac3bdb2010-05-30 01:49:25 +000018// CHECK-CC1: FunctionDecl:{ResultType int}{TypedText f}{LeftParen (}{Placeholder int}{RightParen )} (12)
Douglas Gregor4710e5b2010-05-28 00:49:12 +000019// CHECK-CC1-NOT: NotImplemented:{TypedText float} (40)
Douglas Gregor5ac3bdb2010-05-30 01:49:25 +000020// CHECK-CC1: ParmDecl:{ResultType int}{TypedText j} (2)
Douglas Gregor12e13132010-05-26 22:00:08 +000021// CHECK-CC1: NotImplemented:{TypedText sizeof}{LeftParen (}{Placeholder expression-or-type}{RightParen )} (30)
Douglas Gregor8071e422010-08-15 06:18:01 +000022// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:7:9 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC1a %s
Douglas Gregor8071e422010-08-15 06:18:01 +000023// CHECK-CC1a: ParmDecl:{ResultType int}{TypedText j} (2)
24// CHECK-CC1a: NotImplemented:{TypedText sizeof}{LeftParen (}{Placeholder expression-or-type}{RightParen )} (30)
Douglas Gregorf5586f62010-08-16 18:08:11 +000025// CHECK-CC1a: FunctionDecl:{ResultType int}{TypedText f}{LeftParen (}{Placeholder int}{RightParen )} (12)
Douglas Gregor8071e422010-08-15 06:18:01 +000026// CHECK-CC1a: macro definition:{TypedText __VERSION__} (70)
Douglas Gregor5ac3bdb2010-05-30 01:49:25 +000027// RUN: c-index-test -code-completion-at=%s:7:14 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC3 %s
Douglas Gregor1abc6bc2010-08-04 16:47:14 +000028// RUN: env CINDEXTEST_EDITING=1 c-index-test -code-completion-at=%s:7:14 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC3 %s
Douglas Gregor5ac3bdb2010-05-30 01:49:25 +000029// CHECK-CC3: macro definition:{TypedText __VERSION__} (70)
30// CHECK-CC3: FunctionDecl:{ResultType int}{TypedText f}{LeftParen (}{Placeholder int}{RightParen )} (50)
31// CHECK-CC3-NOT: NotImplemented:{TypedText float} (40)
32// CHECK-CC3: ParmDecl:{ResultType int}{TypedText j} (8)
33// CHECK-CC3: NotImplemented:{TypedText sizeof}{LeftParen (}{Placeholder expressio
34
35// RUN: c-index-test -code-completion-at=%s:7:18 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC3 %s
36// RUN: c-index-test -code-completion-at=%s:7:22 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC3 %s
Douglas Gregor4710e5b2010-05-28 00:49:12 +000037// RUN: c-index-test -code-completion-at=%s:7:2 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC2 %s
38// CHECK-CC2: macro definition:{TypedText __VERSION__} (70)
39// CHECK-CC2: FunctionDecl:{ResultType int}{TypedText f}{LeftParen (}{Placeholder int}{RightParen )} (50)
40// CHECK-CC2: NotImplemented:{TypedText float} (40)
41// CHECK-CC2: ParmDecl:{ResultType int}{TypedText j} (8)
42// CHECK-CC2: NotImplemented:{TypedText sizeof}{LeftParen (}{Placeholder expression-or-type}{RightParen )} (30)
Douglas Gregorbd6c76f2010-05-30 22:23:08 +000043// RUN: c-index-test -code-completion-at=%s:11:16 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC4 %s
44// CHECK-CC4: FunctionDecl:{ResultType int}{TypedText f}{LeftParen (}{Placeholder int}{RightParen )} (50)
45// CHECK-CC4: VarDecl:{ResultType struct X}{TypedText f1} (50)
46
Douglas Gregor33611e02010-05-30 22:59:50 +000047// RUN: c-index-test -code-completion-at=%s:13:28 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC5 %s
48// CHECK-CC5: NotImplemented:{TypedText void} (40)
49// CHECK-CC5: NotImplemented:{TypedText volatile} (40)