summaryrefslogtreecommitdiffstats
path: root/test/CodeCompletion
diff options
context:
space:
mode:
authorJordan Rose <jordan_rose@apple.com>2012-06-15 18:19:56 +0000
committerJordan Rose <jordan_rose@apple.com>2012-06-15 18:19:56 +0000
commit1f6e22d14419db7162202854190f690f393daf2d (patch)
tree202c87e28bf7167e36baf14866819cfe7ca01a63 /test/CodeCompletion
parent50571a9fd8871c722e8655c7c2c3b2871a0d14c1 (diff)
[completion] Add completions for @"..." and @(...), and tidy up @[] and @{}.
Specifically, @[] and @{} didn't have a type associated with them; we now use "NSArray *" and "NSDictionary *", respectively. @"" has the type "NSString *". @(), unfortunately, has type "id", since it (currently) may be either an NSNumber or an NSString. Add a test for all the Objective-C at-expression completions. <rdar://problem/11507708&11507668&11507711> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158533 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeCompletion')
-rw-r--r--test/CodeCompletion/objc-expr.m17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/CodeCompletion/objc-expr.m b/test/CodeCompletion/objc-expr.m
new file mode 100644
index 0000000000..82ce5381fd
--- /dev/null
+++ b/test/CodeCompletion/objc-expr.m
@@ -0,0 +1,17 @@
+// Note: the run lines follow all tests, since line/column matter here
+
+id testCompleteAfterAtSign() {
+ return @"";
+}
+
+// RUN: %clang_cc1 -fsyntax-only -code-completion-patterns -code-completion-at=%s:4:11 %s -fno-const-strings -o - | FileCheck -check-prefix=AT %s
+// CHECK-AT: COMPLETION: Pattern : [#NSString *#]"<#string#>"
+// CHECK-AT: COMPLETION: Pattern : [#id#]( <#expression#> )
+// CHECK-AT: COMPLETION: Pattern : [#NSArray *#][ <#objects, ...#> ]
+// CHECK-AT: COMPLETION: Pattern : [#char[]#]encode(<#type-name#>)
+// CHECK-AT: COMPLETION: Pattern : [#Protocol *#]protocol(<#protocol-name#>)
+// CHECK-AT: COMPLETION: Pattern : [#SEL#]selector(<#selector#>)
+// CHECK-AT: COMPLETION: Pattern : [#NSDictionary *#]{ <#key#> : <#object, ...#> }
+
+// RUN: %clang_cc1 -fsyntax-only -code-completion-patterns -code-completion-at=%s:4:11 %s -fconst-strings -o - | FileCheck -check-prefix=CONST-STRINGS %s
+// CHECK-CONST-STRINGS: COMPLETION: Pattern : [#const char[]#]encode(<#type-name#>)