blob: b7bed8c5fde8047f9566d04043cf2bfad101f1e5 [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 Gregor12e13132010-05-26 22:00:08 +000016// CHECK-CC1: macro definition:{TypedText __VERSION__} (70)
Douglas Gregor5ac3bdb2010-05-30 01:49:25 +000017// CHECK-CC1: FunctionDecl:{ResultType int}{TypedText f}{LeftParen (}{Placeholder int}{RightParen )} (12)
Douglas Gregor4710e5b2010-05-28 00:49:12 +000018// CHECK-CC1-NOT: NotImplemented:{TypedText float} (40)
Douglas Gregor5ac3bdb2010-05-30 01:49:25 +000019// CHECK-CC1: ParmDecl:{ResultType int}{TypedText j} (2)
Douglas Gregor12e13132010-05-26 22:00:08 +000020// CHECK-CC1: NotImplemented:{TypedText sizeof}{LeftParen (}{Placeholder expression-or-type}{RightParen )} (30)
Douglas Gregor5ac3bdb2010-05-30 01:49:25 +000021// RUN: c-index-test -code-completion-at=%s:7:14 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC3 %s
22// CHECK-CC3: macro definition:{TypedText __VERSION__} (70)
23// CHECK-CC3: FunctionDecl:{ResultType int}{TypedText f}{LeftParen (}{Placeholder int}{RightParen )} (50)
24// CHECK-CC3-NOT: NotImplemented:{TypedText float} (40)
25// CHECK-CC3: ParmDecl:{ResultType int}{TypedText j} (8)
26// CHECK-CC3: NotImplemented:{TypedText sizeof}{LeftParen (}{Placeholder expressio
27
28// RUN: c-index-test -code-completion-at=%s:7:18 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC3 %s
29// 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 +000030// RUN: c-index-test -code-completion-at=%s:7:2 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC2 %s
31// CHECK-CC2: macro definition:{TypedText __VERSION__} (70)
32// CHECK-CC2: FunctionDecl:{ResultType int}{TypedText f}{LeftParen (}{Placeholder int}{RightParen )} (50)
33// CHECK-CC2: NotImplemented:{TypedText float} (40)
34// CHECK-CC2: ParmDecl:{ResultType int}{TypedText j} (8)
35// CHECK-CC2: NotImplemented:{TypedText sizeof}{LeftParen (}{Placeholder expression-or-type}{RightParen )} (30)
Douglas Gregorbd6c76f2010-05-30 22:23:08 +000036// RUN: c-index-test -code-completion-at=%s:11:16 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC4 %s
37// CHECK-CC4: FunctionDecl:{ResultType int}{TypedText f}{LeftParen (}{Placeholder int}{RightParen )} (50)
38// CHECK-CC4: VarDecl:{ResultType struct X}{TypedText f1} (50)
39
Douglas Gregor33611e02010-05-30 22:59:50 +000040// RUN: c-index-test -code-completion-at=%s:13:28 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC5 %s
41// CHECK-CC5: NotImplemented:{TypedText void} (40)
42// CHECK-CC5: NotImplemented:{TypedText volatile} (40)