Douglas Gregor | f44e854 | 2010-08-24 19:08:16 +0000 | [diff] [blame] | 1 | // The line and column layout of this test is significant. Run lines |
| 2 | // are at the end. |
| 3 | |
| 4 | #if 1 |
| 5 | #endif |
| 6 | |
Douglas Gregor | 1fbb447 | 2010-08-24 20:21:13 +0000 | [diff] [blame] | 7 | #define FOO(a, b) a##b |
| 8 | #define BAR |
| 9 | #ifdef FOO |
| 10 | #endif |
| 11 | #if defined(FOO) |
| 12 | #endif |
Douglas Gregor | f44e854 | 2010-08-24 19:08:16 +0000 | [diff] [blame] | 13 | |
Douglas Gregor | f29c523 | 2010-08-24 22:20:20 +0000 | [diff] [blame] | 14 | FOO(in,t) value; |
| 15 | |
Douglas Gregor | f44e854 | 2010-08-24 19:08:16 +0000 | [diff] [blame] | 16 | // RUN: c-index-test -code-completion-at=%s:4:2 %s | FileCheck -check-prefix=CHECK-CC1 %s |
Douglas Gregor | 8ec904c | 2010-10-19 00:03:23 +0000 | [diff] [blame] | 17 | // CHECK-CC1: NotImplemented:{TypedText define}{HorizontalSpace }{Placeholder macro} (40) |
| 18 | // CHECK-CC1-NEXT: NotImplemented:{TypedText define}{HorizontalSpace }{Placeholder macro}{LeftParen (}{Placeholder args}{RightParen )} (40) |
| 19 | // CHECK-CC1-NEXT: NotImplemented:{TypedText error}{HorizontalSpace }{Placeholder message} (40) |
| 20 | // CHECK-CC1-NEXT: NotImplemented:{TypedText if}{HorizontalSpace }{Placeholder condition} (40) |
| 21 | // CHECK-CC1-NEXT: NotImplemented:{TypedText ifdef}{HorizontalSpace }{Placeholder macro} (40) |
| 22 | // CHECK-CC1-NEXT: NotImplemented:{TypedText ifndef}{HorizontalSpace }{Placeholder macro} (40) |
| 23 | // CHECK-CC1-NEXT: NotImplemented:{TypedText import}{HorizontalSpace }{Text "}{Placeholder header}{Text "} (40) |
| 24 | // CHECK-CC1-NEXT: NotImplemented:{TypedText import}{HorizontalSpace }{Text <}{Placeholder header}{Text >} (40) |
| 25 | // CHECK-CC1-NEXT: NotImplemented:{TypedText include}{HorizontalSpace }{Text "}{Placeholder header}{Text "} (40) |
| 26 | // CHECK-CC1-NEXT: NotImplemented:{TypedText include}{HorizontalSpace }{Text <}{Placeholder header}{Text >} (40) |
| 27 | // CHECK-CC1-NEXT: NotImplemented:{TypedText include_next}{HorizontalSpace }{Text "}{Placeholder header}{Text "} (40) |
| 28 | // CHECK-CC1-NEXT: NotImplemented:{TypedText include_next}{HorizontalSpace }{Text <}{Placeholder header}{Text >} (40) |
| 29 | // CHECK-CC1-NEXT: NotImplemented:{TypedText line}{HorizontalSpace }{Placeholder number} (40) |
| 30 | // CHECK-CC1-NEXT: NotImplemented:{TypedText line}{HorizontalSpace }{Placeholder number}{HorizontalSpace }{Text "}{Placeholder filename}{Text "} (40) |
| 31 | // CHECK-CC1-NEXT: NotImplemented:{TypedText pragma}{HorizontalSpace }{Placeholder arguments} (40) |
| 32 | // CHECK-CC1-NEXT: NotImplemented:{TypedText undef}{HorizontalSpace }{Placeholder macro} (40) |
| 33 | // CHECK-CC1-NEXT: NotImplemented:{TypedText warning}{HorizontalSpace }{Placeholder message} (40) |
Douglas Gregor | f44e854 | 2010-08-24 19:08:16 +0000 | [diff] [blame] | 34 | // RUN: c-index-test -code-completion-at=%s:5:2 %s | FileCheck -check-prefix=CHECK-CC2 %s |
Douglas Gregor | 8ec904c | 2010-10-19 00:03:23 +0000 | [diff] [blame] | 35 | // CHECK-CC2: NotImplemented:{TypedText define}{HorizontalSpace }{Placeholder macro} (40) |
| 36 | // CHECK-CC2-NEXT: NotImplemented:{TypedText define}{HorizontalSpace }{Placeholder macro}{LeftParen (}{Placeholder args}{RightParen )} (40) |
| 37 | // CHECK-CC2-NEXT: NotImplemented:{TypedText elif}{HorizontalSpace }{Placeholder condition} (40) |
| 38 | // CHECK-CC2-NEXT: NotImplemented:{TypedText else} (40) |
| 39 | // CHECK-CC2-NEXT: NotImplemented:{TypedText endif} (40) |
| 40 | // CHECK-CC2-NEXT: NotImplemented:{TypedText error}{HorizontalSpace }{Placeholder message} (40) |
| 41 | // CHECK-CC2-NEXT: NotImplemented:{TypedText if}{HorizontalSpace }{Placeholder condition} (40) |
| 42 | // CHECK-CC2-NEXT: NotImplemented:{TypedText ifdef}{HorizontalSpace }{Placeholder macro} (40) |
| 43 | // CHECK-CC2-NEXT: NotImplemented:{TypedText ifndef}{HorizontalSpace }{Placeholder macro} (40) |
| 44 | // CHECK-CC2-NEXT: NotImplemented:{TypedText import}{HorizontalSpace }{Text "}{Placeholder header}{Text "} (40) |
| 45 | // CHECK-CC2-NEXT: NotImplemented:{TypedText import}{HorizontalSpace }{Text <}{Placeholder header}{Text >} (40) |
| 46 | // CHECK-CC2-NEXT: NotImplemented:{TypedText include}{HorizontalSpace }{Text "}{Placeholder header}{Text "} (40) |
| 47 | // CHECK-CC2-NEXT: NotImplemented:{TypedText include}{HorizontalSpace }{Text <}{Placeholder header}{Text >} (40) |
| 48 | // CHECK-CC2-NEXT: NotImplemented:{TypedText include_next}{HorizontalSpace }{Text "}{Placeholder header}{Text "} (40) |
| 49 | // CHECK-CC2-NEXT: NotImplemented:{TypedText include_next}{HorizontalSpace }{Text <}{Placeholder header}{Text >} (40) |
| 50 | // CHECK-CC2-NEXT: NotImplemented:{TypedText line}{HorizontalSpace }{Placeholder number} (40) |
| 51 | // CHECK-CC2-NEXT: NotImplemented:{TypedText line}{HorizontalSpace }{Placeholder number}{HorizontalSpace }{Text "}{Placeholder filename}{Text "} (40) |
| 52 | // CHECK-CC2-NEXT: NotImplemented:{TypedText pragma}{HorizontalSpace }{Placeholder arguments} (40) |
| 53 | // CHECK-CC2-NEXT: NotImplemented:{TypedText undef}{HorizontalSpace }{Placeholder macro} (40) |
| 54 | // CHECK-CC2-NEXT: NotImplemented:{TypedText warning}{HorizontalSpace }{Placeholder message} (40) |
Douglas Gregor | 1fbb447 | 2010-08-24 20:21:13 +0000 | [diff] [blame] | 55 | // RUN: c-index-test -code-completion-at=%s:9:8 %s | FileCheck -check-prefix=CHECK-CC3 %s |
Douglas Gregor | 8ec904c | 2010-10-19 00:03:23 +0000 | [diff] [blame] | 56 | // CHECK-CC3: NotImplemented:{TypedText BAR} (40) |
| 57 | // CHECK-CC3: NotImplemented:{TypedText FOO} (40) |
Douglas Gregor | 1fbb447 | 2010-08-24 20:21:13 +0000 | [diff] [blame] | 58 | // RUN: c-index-test -code-completion-at=%s:11:12 %s | FileCheck -check-prefix=CHECK-CC3 %s |
| 59 | // RUN: c-index-test -code-completion-at=%s:11:13 %s | FileCheck -check-prefix=CHECK-CC3 %s |
Douglas Gregor | f29c523 | 2010-08-24 22:20:20 +0000 | [diff] [blame] | 60 | // RUN: c-index-test -code-completion-at=%s:11:5 %s | FileCheck -check-prefix=CHECK-CC4 %s |
| 61 | // CHECK-CC4: macro definition:{TypedText BAR} (70) |
| 62 | // CHECK-CC4: macro definition:{TypedText FOO}{LeftParen (}{Placeholder a}{Comma , }{Placeholder b}{RightParen )} (70) |
| 63 | // RUN: c-index-test -code-completion-at=%s:14:5 %s | FileCheck -check-prefix=CHECK-CC5 %s |
Douglas Gregor | 08f43cd | 2010-09-20 23:11:55 +0000 | [diff] [blame] | 64 | // CHECK-CC5: NotImplemented:{TypedText const} (50) |
| 65 | // CHECK-CC5: NotImplemented:{TypedText double} (50) |
| 66 | // CHECK-CC5: NotImplemented:{TypedText enum} (50) |
Douglas Gregor | 8ec904c | 2010-10-19 00:03:23 +0000 | [diff] [blame] | 67 | // CHECK-CC5: NotImplemented:{TypedText extern} (40) |
Douglas Gregor | 08f43cd | 2010-09-20 23:11:55 +0000 | [diff] [blame] | 68 | // CHECK-CC5: NotImplemented:{TypedText float} (50) |
Douglas Gregor | f29c523 | 2010-08-24 22:20:20 +0000 | [diff] [blame] | 69 | // CHECK-CC5: macro definition:{TypedText FOO}{LeftParen (}{Placeholder a}{Comma , }{Placeholder b}{RightParen )} (70) |
Douglas Gregor | 08f43cd | 2010-09-20 23:11:55 +0000 | [diff] [blame] | 70 | // CHECK-CC5: TypedefDecl:{TypedText id} (50) |
Douglas Gregor | 8ec904c | 2010-10-19 00:03:23 +0000 | [diff] [blame] | 71 | // CHECK-CC5: NotImplemented:{TypedText inline} (40) |
Douglas Gregor | 08f43cd | 2010-09-20 23:11:55 +0000 | [diff] [blame] | 72 | // CHECK-CC5: NotImplemented:{TypedText int} (50) |
| 73 | // CHECK-CC5: NotImplemented:{TypedText long} (50) |
Douglas Gregor | 721f359 | 2010-08-25 18:41:16 +0000 | [diff] [blame] | 74 | |
| 75 | // Same tests as above, but with completion caching. |
| 76 | // RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:4:2 %s | FileCheck -check-prefix=CHECK-CC1 %s |
| 77 | // RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:5:2 %s | FileCheck -check-prefix=CHECK-CC2 %s |
| 78 | // RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:9:8 %s | FileCheck -check-prefix=CHECK-CC3 %s |
| 79 | // RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:11:5 %s | FileCheck -check-prefix=CHECK-CC4 %s |
| 80 | // RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:14:5 %s | FileCheck -check-prefix=CHECK-CC5 %s |