From 3a7ad25eb695a1d83a35de02aa489a18cc7b1278 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Tue, 24 Aug 2010 19:08:16 +0000 Subject: Introduce basic code-completion support for preprocessor directives, e.g., after a "#" we'll suggest #if, #ifdef, etc. llvm-svn: 111943 --- clang/test/Index/complete-preprocessor.m | 47 ++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 clang/test/Index/complete-preprocessor.m (limited to 'clang/test/Index/complete-preprocessor.m') diff --git a/clang/test/Index/complete-preprocessor.m b/clang/test/Index/complete-preprocessor.m new file mode 100644 index 00000000000..b951c1622e8 --- /dev/null +++ b/clang/test/Index/complete-preprocessor.m @@ -0,0 +1,47 @@ +// The line and column layout of this test is significant. Run lines +// are at the end. + +#if 1 +#endif + + + +// RUN: c-index-test -code-completion-at=%s:4:2 %s | FileCheck -check-prefix=CHECK-CC1 %s +// CHECK-CC1: NotImplemented:{TypedText define}{HorizontalSpace }{Placeholder macro} (30) +// CHECK-CC1-NEXT: NotImplemented:{TypedText define}{HorizontalSpace }{Placeholder macro}{LeftParen (}{Placeholder args}{RightParen )} (30) +// CHECK-CC1-NEXT: NotImplemented:{TypedText error}{HorizontalSpace }{Placeholder message} (30) +// CHECK-CC1-NEXT: NotImplemented:{TypedText if}{HorizontalSpace }{Placeholder condition} (30) +// CHECK-CC1-NEXT: NotImplemented:{TypedText ifdef}{HorizontalSpace }{Placeholder macro} (30) +// CHECK-CC1-NEXT: NotImplemented:{TypedText ifndef}{HorizontalSpace }{Placeholder macro} (30) +// CHECK-CC1-NEXT: NotImplemented:{TypedText import}{HorizontalSpace }{Text "}{Placeholder header}{Text "} (30) +// CHECK-CC1-NEXT: NotImplemented:{TypedText import}{HorizontalSpace }{Text <}{Placeholder header}{Text >} (30) +// CHECK-CC1-NEXT: NotImplemented:{TypedText include}{HorizontalSpace }{Text "}{Placeholder header}{Text "} (30) +// CHECK-CC1-NEXT: NotImplemented:{TypedText include}{HorizontalSpace }{Text <}{Placeholder header}{Text >} (30) +// CHECK-CC1-NEXT: NotImplemented:{TypedText include_next}{HorizontalSpace }{Text "}{Placeholder header}{Text "} (30) +// CHECK-CC1-NEXT: NotImplemented:{TypedText include_next}{HorizontalSpace }{Text <}{Placeholder header}{Text >} (30) +// CHECK-CC1-NEXT: NotImplemented:{TypedText line}{HorizontalSpace }{Placeholder number} (30) +// CHECK-CC1-NEXT: NotImplemented:{TypedText line}{HorizontalSpace }{Placeholder number}{HorizontalSpace }{Text "}{Placeholder filename}{Text "} (30) +// CHECK-CC1-NEXT: NotImplemented:{TypedText pragma}{HorizontalSpace }{Placeholder arguments} (30) +// CHECK-CC1-NEXT: NotImplemented:{TypedText undef}{HorizontalSpace }{Placeholder macro} (30) +// CHECK-CC1-NEXT: NotImplemented:{TypedText warning}{HorizontalSpace }{Placeholder message} (30) +// RUN: c-index-test -code-completion-at=%s:5:2 %s | FileCheck -check-prefix=CHECK-CC2 %s +// CHECK-CC2: NotImplemented:{TypedText define}{HorizontalSpace }{Placeholder macro} (30) +// CHECK-CC2-NEXT: NotImplemented:{TypedText define}{HorizontalSpace }{Placeholder macro}{LeftParen (}{Placeholder args}{RightParen )} (30) +// CHECK-CC2-NEXT: NotImplemented:{TypedText elif}{HorizontalSpace }{Placeholder condition} (30) +// CHECK-CC2-NEXT: NotImplemented:{TypedText else} (30) +// CHECK-CC2-NEXT: NotImplemented:{TypedText endif} (30) +// CHECK-CC2-NEXT: NotImplemented:{TypedText error}{HorizontalSpace }{Placeholder message} (30) +// CHECK-CC2-NEXT: NotImplemented:{TypedText if}{HorizontalSpace }{Placeholder condition} (30) +// CHECK-CC2-NEXT: NotImplemented:{TypedText ifdef}{HorizontalSpace }{Placeholder macro} (30) +// CHECK-CC2-NEXT: NotImplemented:{TypedText ifndef}{HorizontalSpace }{Placeholder macro} (30) +// CHECK-CC2-NEXT: NotImplemented:{TypedText import}{HorizontalSpace }{Text "}{Placeholder header}{Text "} (30) +// CHECK-CC2-NEXT: NotImplemented:{TypedText import}{HorizontalSpace }{Text <}{Placeholder header}{Text >} (30) +// CHECK-CC2-NEXT: NotImplemented:{TypedText include}{HorizontalSpace }{Text "}{Placeholder header}{Text "} (30) +// CHECK-CC2-NEXT: NotImplemented:{TypedText include}{HorizontalSpace }{Text <}{Placeholder header}{Text >} (30) +// CHECK-CC2-NEXT: NotImplemented:{TypedText include_next}{HorizontalSpace }{Text "}{Placeholder header}{Text "} (30) +// CHECK-CC2-NEXT: NotImplemented:{TypedText include_next}{HorizontalSpace }{Text <}{Placeholder header}{Text >} (30) +// CHECK-CC2-NEXT: NotImplemented:{TypedText line}{HorizontalSpace }{Placeholder number} (30) +// CHECK-CC2-NEXT: NotImplemented:{TypedText line}{HorizontalSpace }{Placeholder number}{HorizontalSpace }{Text "}{Placeholder filename}{Text "} (30) +// CHECK-CC2-NEXT: NotImplemented:{TypedText pragma}{HorizontalSpace }{Placeholder arguments} (30) +// CHECK-CC2-NEXT: NotImplemented:{TypedText undef}{HorizontalSpace }{Placeholder macro} (30) +// CHECK-CC2-NEXT: NotImplemented:{TypedText warning}{HorizontalSpace }{Placeholder message} (30) -- cgit v1.2.3