blob: d6ad8abdf9f8d0448f419940c25a2e047468e150 [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 Gregoraa5f77b2010-08-23 21:54:33 +000017// CHECK-CC1: NotImplemented:{TypedText __PRETTY_FUNCTION__} (60)
Douglas Gregor12e13132010-05-26 22:00:08 +000018// CHECK-CC1: macro definition:{TypedText __VERSION__} (70)
Douglas Gregor5ac3bdb2010-05-30 01:49:25 +000019// CHECK-CC1: FunctionDecl:{ResultType int}{TypedText f}{LeftParen (}{Placeholder int}{RightParen )} (12)
Douglas Gregor4710e5b2010-05-28 00:49:12 +000020// CHECK-CC1-NOT: NotImplemented:{TypedText float} (40)
Douglas Gregor5ac3bdb2010-05-30 01:49:25 +000021// CHECK-CC1: ParmDecl:{ResultType int}{TypedText j} (2)
Douglas Gregor12e13132010-05-26 22:00:08 +000022// CHECK-CC1: NotImplemented:{TypedText sizeof}{LeftParen (}{Placeholder expression-or-type}{RightParen )} (30)
Douglas Gregor8071e422010-08-15 06:18:01 +000023// 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 Gregoraa5f77b2010-08-23 21:54:33 +000024// CHECK-CC1a: NotImplemented:{TypedText __PRETTY_FUNCTION__} (60)
Douglas Gregor8071e422010-08-15 06:18:01 +000025// CHECK-CC1a: ParmDecl:{ResultType int}{TypedText j} (2)
26// CHECK-CC1a: NotImplemented:{TypedText sizeof}{LeftParen (}{Placeholder expression-or-type}{RightParen )} (30)
Douglas Gregorf5586f62010-08-16 18:08:11 +000027// CHECK-CC1a: FunctionDecl:{ResultType int}{TypedText f}{LeftParen (}{Placeholder int}{RightParen )} (12)
Douglas Gregor8071e422010-08-15 06:18:01 +000028// CHECK-CC1a: macro definition:{TypedText __VERSION__} (70)
Douglas Gregor5ac3bdb2010-05-30 01:49:25 +000029// 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 +000030// 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 +000031// CHECK-CC3: macro definition:{TypedText __VERSION__} (70)
32// CHECK-CC3: FunctionDecl:{ResultType int}{TypedText f}{LeftParen (}{Placeholder int}{RightParen )} (50)
33// CHECK-CC3-NOT: NotImplemented:{TypedText float} (40)
34// CHECK-CC3: ParmDecl:{ResultType int}{TypedText j} (8)
35// CHECK-CC3: NotImplemented:{TypedText sizeof}{LeftParen (}{Placeholder expressio
36
37// RUN: c-index-test -code-completion-at=%s:7:18 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC3 %s
38// 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 +000039// RUN: c-index-test -code-completion-at=%s:7:2 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC2 %s
40// CHECK-CC2: macro definition:{TypedText __VERSION__} (70)
41// CHECK-CC2: FunctionDecl:{ResultType int}{TypedText f}{LeftParen (}{Placeholder int}{RightParen )} (50)
42// CHECK-CC2: NotImplemented:{TypedText float} (40)
43// CHECK-CC2: ParmDecl:{ResultType int}{TypedText j} (8)
44// CHECK-CC2: NotImplemented:{TypedText sizeof}{LeftParen (}{Placeholder expression-or-type}{RightParen )} (30)
Douglas Gregorbd6c76f2010-05-30 22:23:08 +000045// RUN: c-index-test -code-completion-at=%s:11:16 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC4 %s
46// CHECK-CC4: FunctionDecl:{ResultType int}{TypedText f}{LeftParen (}{Placeholder int}{RightParen )} (50)
47// CHECK-CC4: VarDecl:{ResultType struct X}{TypedText f1} (50)
48
Douglas Gregor33611e02010-05-30 22:59:50 +000049// RUN: c-index-test -code-completion-at=%s:13:28 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC5 %s
50// CHECK-CC5: NotImplemented:{TypedText void} (40)
51// CHECK-CC5: NotImplemented:{TypedText volatile} (40)