summaryrefslogtreecommitdiff
path: root/clang/test/Index/complete-exprs.m
diff options
context:
space:
mode:
authorCarlo Zancanaro <carlo@pc-4w14-0.cs.usyd.edu.au>2012-10-15 17:10:06 +1100
committerCarlo Zancanaro <carlo@pc-4w14-0.cs.usyd.edu.au>2012-10-15 17:10:06 +1100
commitbe1de4be954c80875ad4108e0a33e8e131b2f2c0 (patch)
tree1fbbecf276bf7c7bdcbb4dd446099d6d90eaa516 /clang/test/Index/complete-exprs.m
parentc4626a62754862d20b41e8a46a3574264ea80e6d (diff)
parentf1bd2e48c5324d3f7cda4090c87f8a5b6f463ce2 (diff)
Merge branch 'master' of ssh://bitbucket.org/czan/honours
Diffstat (limited to 'clang/test/Index/complete-exprs.m')
-rw-r--r--clang/test/Index/complete-exprs.m49
1 files changed, 49 insertions, 0 deletions
diff --git a/clang/test/Index/complete-exprs.m b/clang/test/Index/complete-exprs.m
new file mode 100644
index 0000000..c3ff63b
--- /dev/null
+++ b/clang/test/Index/complete-exprs.m
@@ -0,0 +1,49 @@
+typedef signed char BOOL;
+#define YES ((BOOL)1)
+#define NO ((BOOL)0)
+#define bool _Bool
+@interface NSArray + (id)arrayWithObjects:(const id [])objects count:(unsigned long)cnt; @end
+@interface A
+- (int)method:(id)param1;
+@property int prop1;
+@end
+__strong id global;
+@implementation A
+- (int)method:(id)param1 {
+ void foo(bool (^block)(id x, A* y));
+ for(BOOL B = YES; ; ) { }
+ @[ global ];
+ @{ global : global };
+}
+@end
+
+// RUN: c-index-test -code-completion-at=%s:13:2 %s | FileCheck -check-prefix=CHECK-CC1 %s
+// CHECK-CC1: NotImplemented:{TypedText @[}{HorizontalSpace }{Placeholder objects, ...}{HorizontalSpace }{RightBracket ]} (40)
+// CHECK-CC1: NotImplemented:{TypedText @{}{HorizontalSpace }{Placeholder key}{HorizontalSpace }{Colon :}{HorizontalSpace }{Placeholder object, ...}{HorizontalSpace }{RightBrace }} (40)
+// CHECK-CC1: NotImplemented:{ResultType SEL}{TypedText _cmd} (80)
+// CHECK-CC1: TypedefDecl:{TypedText BOOL} (50)
+// CHECK-CC1: macro definition:{TypedText bool} (51)
+// CHECK-CC1: macro definition:{TypedText NO} (65)
+// CHECK-CC1: NotImplemented:{ResultType A *}{TypedText self} (34)
+// CHECK-CC1: macro definition:{TypedText YES} (65)
+// RUN: c-index-test -code-completion-at=%s:14:7 %s | FileCheck -check-prefix=CHECK-CC2 %s
+// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:14:7 %s | FileCheck -check-prefix=CHECK-CC2 %s
+// CHECK-CC2: TypedefDecl:{TypedText BOOL} (50)
+// CHECK-CC2: NotImplemented:{TypedText char} (50)
+// CHECK-CC2: NotImplemented:{ResultType size_t}{TypedText sizeof}{LeftParen (}{Placeholder expression-or-type}{RightParen )} (40)
+// RUN: c-index-test -code-completion-at=%s:15:1 -fobjc-arc -fobjc-nonfragile-abi %s | FileCheck -check-prefix=CHECK-CC3 %s
+// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:15:1 -fobjc-arc -fobjc-nonfragile-abi %s | FileCheck -check-prefix=CHECK-CC3 %s
+// CHECK-CC3: FunctionDecl:{ResultType void}{TypedText foo}{LeftParen (}{Placeholder ^bool(id x, A *y)block}{RightParen )} (34)
+// CHECK-CC3: VarDecl:{ResultType id}{TypedText global} (50)
+// CHECK-CC3: ParmDecl:{ResultType id}{TypedText param1} (34)
+
+// RUN: c-index-test -code-completion-at=%s:15:5 %s | FileCheck -check-prefix=CHECK-CC4 %s
+// RUN: c-index-test -code-completion-at=%s:16:5 %s | FileCheck -check-prefix=CHECK-CC4 %s
+// RUN: c-index-test -code-completion-at=%s:16:14 %s | FileCheck -check-prefix=CHECK-CC4 %s
+// CHECK-CC4: NotImplemented:{TypedText @[}{HorizontalSpace }{Placeholder objects, ...}{HorizontalSpace }{RightBracket ]} (40)
+// CHECK-CC4: NotImplemented:{TypedText @{}{HorizontalSpace }{Placeholder key}{HorizontalSpace }{Colon :}{HorizontalSpace }{Placeholder object, ...}{HorizontalSpace }{RightBrace }} (40)
+// CHECK-CC4: NotImplemented:{ResultType SEL}{TypedText _cmd} (80)
+// CHECK-CC4: macro definition:{TypedText bool} (51)
+// CHECK-CC4: macro definition:{TypedText NO} (65)
+// CHECK-CC4: NotImplemented:{ResultType A *}{TypedText self} (34)
+// CHECK-CC4: macro definition:{TypedText YES} (65)