Douglas Gregor | 64538cf | 2010-04-06 15:09:27 +0000 | [diff] [blame] | 1 | // Note: the run lines follow their respective tests, since line/column |
| 2 | // matter in this test. |
| 3 | |
| 4 | int f(int); |
| 5 | |
| 6 | int test(int i, int j, int k, int l) { |
| 7 | return i | j | k & l; |
| 8 | } |
| 9 | |
Douglas Gregor | bd6c76f | 2010-05-30 22:23:08 +0000 | [diff] [blame] | 10 | struct X f1 = { 17 }; |
| 11 | void f2() { f1(17); } |
| 12 | |
Douglas Gregor | 33611e0 | 2010-05-30 22:59:50 +0000 | [diff] [blame^] | 13 | const char *str = "Hello, \nWorld"; |
| 14 | |
Douglas Gregor | d8e8a58 | 2010-05-25 21:41:55 +0000 | [diff] [blame] | 15 | // RUN: c-index-test -code-completion-at=%s:7:9 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC1 %s |
Douglas Gregor | 12e1313 | 2010-05-26 22:00:08 +0000 | [diff] [blame] | 16 | // CHECK-CC1: macro definition:{TypedText __VERSION__} (70) |
Douglas Gregor | 5ac3bdb | 2010-05-30 01:49:25 +0000 | [diff] [blame] | 17 | // CHECK-CC1: FunctionDecl:{ResultType int}{TypedText f}{LeftParen (}{Placeholder int}{RightParen )} (12) |
Douglas Gregor | 4710e5b | 2010-05-28 00:49:12 +0000 | [diff] [blame] | 18 | // CHECK-CC1-NOT: NotImplemented:{TypedText float} (40) |
Douglas Gregor | 5ac3bdb | 2010-05-30 01:49:25 +0000 | [diff] [blame] | 19 | // CHECK-CC1: ParmDecl:{ResultType int}{TypedText j} (2) |
Douglas Gregor | 12e1313 | 2010-05-26 22:00:08 +0000 | [diff] [blame] | 20 | // CHECK-CC1: NotImplemented:{TypedText sizeof}{LeftParen (}{Placeholder expression-or-type}{RightParen )} (30) |
Douglas Gregor | 5ac3bdb | 2010-05-30 01:49:25 +0000 | [diff] [blame] | 21 | // 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 Gregor | 4710e5b | 2010-05-28 00:49:12 +0000 | [diff] [blame] | 30 | // 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 Gregor | bd6c76f | 2010-05-30 22:23:08 +0000 | [diff] [blame] | 36 | // 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 Gregor | 33611e0 | 2010-05-30 22:59:50 +0000 | [diff] [blame^] | 40 | // 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) |