summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeCompletion/objc-expr.m
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
commit9da05858b444045f56a7371c996c5a6edbd4c2f7 (patch)
tree2329aea39d68bd35dd36964f4fbf99eea96e23ce /clang/test/CodeCompletion/objc-expr.m
parent95dfae824ef82ad51ba5f6b3a1681f2ef5febc45 (diff)
downloadbcm5719-llvm-9da05858b444045f56a7371c996c5a6edbd4c2f7.tar.gz
bcm5719-llvm-9da05858b444045f56a7371c996c5a6edbd4c2f7.zip
[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> llvm-svn: 158533
Diffstat (limited to 'clang/test/CodeCompletion/objc-expr.m')
-rw-r--r--clang/test/CodeCompletion/objc-expr.m17
1 files changed, 17 insertions, 0 deletions
diff --git a/clang/test/CodeCompletion/objc-expr.m b/clang/test/CodeCompletion/objc-expr.m
new file mode 100644
index 00000000000..82ce5381fd2
--- /dev/null
+++ b/clang/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#>)
OpenPOWER on IntegriCloud