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 | |
Douglas Gregor | 58ddb60 | 2010-08-23 23:00:57 +0000 | [diff] [blame] | 4 | int f(int) __attribute__((unavailable)); |
Douglas Gregor | 64538cf | 2010-04-06 15:09:27 +0000 | [diff] [blame] | 5 | |
| 6 | int test(int i, int j, int k, int l) { |
| 7 | return i | j | k & l; |
| 8 | } |
| 9 | |
Douglas Gregor | 58ddb60 | 2010-08-23 23:00:57 +0000 | [diff] [blame] | 10 | struct X __attribute__((deprecated)) f1 = { 17 }; |
Douglas Gregor | bd6c76f | 2010-05-30 22:23:08 +0000 | [diff] [blame] | 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 | aaa107a | 2010-08-23 23:51:41 +0000 | [diff] [blame] | 15 | void f3(const char*, ...) __attribute__((sentinel(0))); |
| 16 | |
| 17 | #define NULL __null |
| 18 | void f4(const char* str) { |
| 19 | f3(str, NULL); |
| 20 | } |
Douglas Gregor | 0268810 | 2010-09-14 23:59:36 +0000 | [diff] [blame] | 21 | |
| 22 | typedef int type; |
| 23 | void f5(float f) { |
| 24 | (type)f; |
| 25 | } |
| 26 | |
Douglas Gregor | d8e8a58 | 2010-05-25 21:41:55 +0000 | [diff] [blame] | 27 | // RUN: c-index-test -code-completion-at=%s:7:9 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC1 %s |
Douglas Gregor | 1abc6bc | 2010-08-04 16:47:14 +0000 | [diff] [blame] | 28 | // 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 Gregor | d754d55 | 2010-09-16 16:21:35 +0000 | [diff] [blame] | 29 | // CHECK-CC1: NotImplemented:{TypedText __PRETTY_FUNCTION__} (65) |
Douglas Gregor | 12e1313 | 2010-05-26 22:00:08 +0000 | [diff] [blame] | 30 | // CHECK-CC1: macro definition:{TypedText __VERSION__} (70) |
Douglas Gregor | 58ddb60 | 2010-08-23 23:00:57 +0000 | [diff] [blame] | 31 | // CHECK-CC1: FunctionDecl:{ResultType int}{TypedText f}{LeftParen (}{Placeholder int}{RightParen )} (12) (unavailable) |
Douglas Gregor | d43dd83 | 2010-08-24 23:40:45 +0000 | [diff] [blame] | 32 | // CHECK-CC1-NOT: NotImplemented:{TypedText float} (65) |
Douglas Gregor | 5ac3bdb | 2010-05-30 01:49:25 +0000 | [diff] [blame] | 33 | // CHECK-CC1: ParmDecl:{ResultType int}{TypedText j} (2) |
Douglas Gregor | 12e1313 | 2010-05-26 22:00:08 +0000 | [diff] [blame] | 34 | // CHECK-CC1: NotImplemented:{TypedText sizeof}{LeftParen (}{Placeholder expression-or-type}{RightParen )} (30) |
Douglas Gregor | 721f359 | 2010-08-25 18:41:16 +0000 | [diff] [blame] | 35 | // 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-CC1 %s |
Douglas Gregor | 5ac3bdb | 2010-05-30 01:49:25 +0000 | [diff] [blame] | 36 | // RUN: c-index-test -code-completion-at=%s:7:14 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC3 %s |
Douglas Gregor | 1abc6bc | 2010-08-04 16:47:14 +0000 | [diff] [blame] | 37 | // 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 Gregor | 5ac3bdb | 2010-05-30 01:49:25 +0000 | [diff] [blame] | 38 | // CHECK-CC3: macro definition:{TypedText __VERSION__} (70) |
| 39 | // CHECK-CC3: FunctionDecl:{ResultType int}{TypedText f}{LeftParen (}{Placeholder int}{RightParen )} (50) |
Douglas Gregor | d754d55 | 2010-09-16 16:21:35 +0000 | [diff] [blame] | 40 | // CHECK-CC3-NOT: NotImplemented:{TypedText float} |
Douglas Gregor | 5ac3bdb | 2010-05-30 01:49:25 +0000 | [diff] [blame] | 41 | // CHECK-CC3: ParmDecl:{ResultType int}{TypedText j} (8) |
| 42 | // CHECK-CC3: NotImplemented:{TypedText sizeof}{LeftParen (}{Placeholder expressio |
| 43 | |
| 44 | // RUN: c-index-test -code-completion-at=%s:7:18 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC3 %s |
| 45 | // 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] | 46 | // RUN: c-index-test -code-completion-at=%s:7:2 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC2 %s |
| 47 | // CHECK-CC2: macro definition:{TypedText __VERSION__} (70) |
| 48 | // CHECK-CC2: FunctionDecl:{ResultType int}{TypedText f}{LeftParen (}{Placeholder int}{RightParen )} (50) |
Douglas Gregor | 08f43cd | 2010-09-20 23:11:55 +0000 | [diff] [blame^] | 49 | // CHECK-CC2: NotImplemented:{TypedText float} (50) |
Douglas Gregor | 4710e5b | 2010-05-28 00:49:12 +0000 | [diff] [blame] | 50 | // CHECK-CC2: ParmDecl:{ResultType int}{TypedText j} (8) |
| 51 | // CHECK-CC2: NotImplemented:{TypedText sizeof}{LeftParen (}{Placeholder expression-or-type}{RightParen )} (30) |
Douglas Gregor | bd6c76f | 2010-05-30 22:23:08 +0000 | [diff] [blame] | 52 | // RUN: c-index-test -code-completion-at=%s:11:16 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC4 %s |
| 53 | // CHECK-CC4: FunctionDecl:{ResultType int}{TypedText f}{LeftParen (}{Placeholder int}{RightParen )} (50) |
Douglas Gregor | 58ddb60 | 2010-08-23 23:00:57 +0000 | [diff] [blame] | 54 | // CHECK-CC4: VarDecl:{ResultType struct X}{TypedText f1} (50) (deprecated) |
Douglas Gregor | bd6c76f | 2010-05-30 22:23:08 +0000 | [diff] [blame] | 55 | |
Douglas Gregor | aaa107a | 2010-08-23 23:51:41 +0000 | [diff] [blame] | 56 | // RUN: c-index-test -code-completion-at=%s:19:3 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC6 %s |
Douglas Gregor | d475aad | 2010-09-20 21:25:19 +0000 | [diff] [blame] | 57 | // CHECK-CC6: FunctionDecl:{ResultType void}{TypedText f3}{LeftParen (}{Placeholder const char *, ...}{Text , NULL}{RightParen )} (50) |
Douglas Gregor | 08f43cd | 2010-09-20 23:11:55 +0000 | [diff] [blame^] | 58 | // CHECK-CC6: NotImplemented:{TypedText void} (50) |
| 59 | // CHECK-CC6: NotImplemented:{TypedText volatile} (50) |
Douglas Gregor | 0268810 | 2010-09-14 23:59:36 +0000 | [diff] [blame] | 60 | |
| 61 | // RUN: c-index-test -code-completion-at=%s:24:4 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC7 %s |
| 62 | // RUN: env CINDEXTEST_EDITING=1 c-index-test -code-completion-at=%s:24:4 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC7 %s |
| 63 | // CHECK-CC7: ParmDecl:{ResultType float}{TypedText f} (8) |
| 64 | // CHECK-CC7: VarDecl:{ResultType struct X}{TypedText f1} (50) (deprecated) |
| 65 | // CHECK-CC7: FunctionDecl:{ResultType void}{TypedText f2}{LeftParen (}{RightParen )} (50) |
| 66 | // CHECK-CC7: FunctionDecl:{ResultType void}{TypedText f3}{LeftParen (}{Placeholder const char *, ...}{Text , NULL}{RightParen )} (50) |
| 67 | // CHECK-CC7: FunctionDecl:{ResultType void}{TypedText f4}{LeftParen (}{Placeholder const char *str}{RightParen )} (50) |
| 68 | // CHECK-CC7: FunctionDecl:{ResultType void}{TypedText f5}{LeftParen (}{Placeholder float f}{RightParen )} (50) |
| 69 | // CHECK-CC7: TypedefDecl:{TypedText type} |