aboutsummaryrefslogtreecommitdiff
path: root/test/Index
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2015-06-21 14:00:56 +0000
committerDimitry Andric <dim@FreeBSD.org>2015-06-21 14:00:56 +0000
commit2e645aa5697838f16ec570eb07c2bee7e13d0e0b (patch)
treea764184c2fc9486979b074250b013a0937ee64e5 /test/Index
parent798321d8eb5630cd4a8f490a4f25e32ef195fb07 (diff)
downloadsrc-2e645aa5697838f16ec570eb07c2bee7e13d0e0b.tar.gz
src-2e645aa5697838f16ec570eb07c2bee7e13d0e0b.zip
Vendor import of clang trunk r240225:vendor/clang/clang-trunk-r240225
Notes
Notes: svn path=/vendor/clang/dist/; revision=284679 svn path=/vendor/clang/clang-trunk-r240225/; revision=284680; tag=vendor/clang/clang-trunk-r240225
Diffstat (limited to 'test/Index')
-rw-r--r--test/Index/comment-objc-decls.m8
-rw-r--r--test/Index/complete-method-decls.m13
-rw-r--r--test/Index/complete-objc-message.m11
-rw-r--r--test/Index/complete-property-flags.m12
-rw-r--r--test/Index/complete-stmt.c2
-rw-r--r--test/Index/pch-depending-on-deleted-module.c8
6 files changed, 46 insertions, 8 deletions
diff --git a/test/Index/comment-objc-decls.m b/test/Index/comment-objc-decls.m
index ae3b0bbf415d..d53757cbc3cc 100644
--- a/test/Index/comment-objc-decls.m
+++ b/test/Index/comment-objc-decls.m
@@ -20,19 +20,19 @@
* \param[in] range output value is unsigned int
* \result return index
*/
-- (unsigned int)MethodMyProto:(id)anObject inRange:(unsigned int)range;
+- (unsigned int)MethodMyProto:(nullable id)anObject inRange:(unsigned int)range;
/**
* \brief PropertyMyProto - This is protocol's property.
*/
-@property (copy) id PropertyMyProto;
+@property (copy, nonnull) id PropertyMyProto;
/**
* \brief ClassMethodMyProto
*/
+ ClassMethodMyProto;
@end
// CHECK: <Declaration>@protocol MyProto\n@end</Declaration>
-// CHECK: <Declaration>- (unsigned int)MethodMyProto:(id)anObject inRange:(unsigned int)range;</Declaration>
-// CHECK: <Declaration>@optional\n@property(readwrite, copy, atomic) id PropertyMyProto;</Declaration>
+// CHECK: <Declaration>- (unsigned int)MethodMyProto:(nullable id)anObject inRange:(unsigned int)range;</Declaration>
+// CHECK: <Declaration>@optional\n@property(readwrite, copy, atomic, nonnull) id PropertyMyProto;</Declaration>
// CHECK: <Declaration>+ (id)ClassMethodMyProto;</Declaration>
/**
diff --git a/test/Index/complete-method-decls.m b/test/Index/complete-method-decls.m
index eceaa833fc3e..0e3780ba3d5f 100644
--- a/test/Index/complete-method-decls.m
+++ b/test/Index/complete-method-decls.m
@@ -82,6 +82,14 @@ typedef A *MyObjectRef;
@end
@implementation I1
+-(void)foo {}
+@end
+
+@interface I2
+-(nonnull I2 *)produceI2:(nullable I2 *)i2;
+@end
+
+@implementation I2
-
@end
@@ -153,6 +161,8 @@ typedef A *MyObjectRef;
// CHECK-CCF: NotImplemented:{TypedText byref} (40)
// CHECK-CCF: NotImplemented:{TypedText in} (40)
// CHECK-CCF: NotImplemented:{TypedText inout} (40)
+// CHECK-CCF: NotImplemented:{TypedText nonnull} (40)
+// CHECK-CCF: NotImplemented:{TypedText nullable} (40)
// CHECK-CCF: NotImplemented:{TypedText oneway} (40)
// CHECK-CCF: NotImplemented:{TypedText out} (40)
// CHECK-CCF: NotImplemented:{TypedText unsigned} (50)
@@ -201,3 +211,6 @@ typedef A *MyObjectRef;
// FIXME: It should be "MyObject <P1> *""
// CHECK-CLASSTY: ObjCInstanceMethodDecl:{LeftParen (}{Text A<P1> *}{RightParen )}{TypedText meth2}
// CHECK-CLASSTY: ObjCInstanceMethodDecl:{LeftParen (}{Text MyObjectRef}{RightParen )}{TypedText meth3}
+
+// RUN: c-index-test -code-completion-at=%s:93:2 %s | FileCheck -check-prefix=CHECK-NULLABILITY %s
+// CHECK-NULLABILITY: ObjCInstanceMethodDecl:{LeftParen (}{Text nonnull }{Text I2 *}{RightParen )}{TypedText produceI2}{TypedText :}{LeftParen (}{Text nullable }{Text I2 *}{RightParen )}{Text i2} (40)
diff --git a/test/Index/complete-objc-message.m b/test/Index/complete-objc-message.m
index 5a7200570bec..a62b49194e83 100644
--- a/test/Index/complete-objc-message.m
+++ b/test/Index/complete-objc-message.m
@@ -189,6 +189,14 @@ void test_DO(DO *d, A* a) {
[d method:a aout:&a];
}
+@interface Nullability
+- (nonnull A *)method:(nullable A *)param;
+@end
+
+void test_Nullability(Nullability *n, A* a) {
+ [n method: a];
+}
+
// RUN: c-index-test -code-completion-at=%s:23:19 %s | FileCheck -check-prefix=CHECK-CC1 %s
// CHECK-CC1: {TypedText categoryClassMethod} (35)
// CHECK-CC1: {TypedText classMethod1:}{Placeholder (id)}{HorizontalSpace }{TypedText withKeyword:}{Placeholder (int)} (35)
@@ -335,3 +343,6 @@ void test_DO(DO *d, A* a) {
// RUN: c-index-test -code-completion-at=%s:189:6 %s | FileCheck -check-prefix=CHECK-DISTRIB-OBJECTS %s
// CHECK-DISTRIB-OBJECTS: ObjCInstanceMethodDecl:{ResultType void}{TypedText method:}{Placeholder (in bycopy A *)}{HorizontalSpace }{TypedText result:}{Placeholder (out byref A **)} (35)
+
+// RUN: c-index-test -code-completion-at=%s:197:6 %s | FileCheck -check-prefix=CHECK-NULLABLE %s
+// CHECK-NULLABLE: ObjCInstanceMethodDecl:{ResultType A * __nonnull}{TypedText method:}{Placeholder (nullable A *)}
diff --git a/test/Index/complete-property-flags.m b/test/Index/complete-property-flags.m
index 13ec1e725f20..9e3fc1aff319 100644
--- a/test/Index/complete-property-flags.m
+++ b/test/Index/complete-property-flags.m
@@ -13,6 +13,10 @@
// CHECK-CC1-NEXT: {TypedText copy}
// CHECK-CC1-NEXT: {TypedText getter}{Text =}{Placeholder method}
// CHECK-CC1-NEXT: {TypedText nonatomic}
+// CHECK-CC1: {TypedText nonnull}
+// CHECK-CC1-NEXT: {TypedText null_resettable}
+// CHECK-CC1-NEXT: {TypedText null_unspecified}
+// CHECK-CC1-NEXT: {TypedText nullable}
// CHECK-CC1-NEXT: {TypedText readonly}
// CHECK-CC1-NEXT: {TypedText readwrite}
// CHECK-CC1-NEXT: {TypedText retain}
@@ -27,6 +31,10 @@
// CHECK-CC1-ARC-NEXT: {TypedText copy}
// CHECK-CC1-ARC-NEXT: {TypedText getter}{Text =}{Placeholder method}
// CHECK-CC1-ARC-NEXT: {TypedText nonatomic}
+// CHECK-CC1-ARC-NEXT: {TypedText nonnull}
+// CHECK-CC1-ARC-NEXT: {TypedText null_resettable}
+// CHECK-CC1-ARC-NEXT: {TypedText null_unspecified}
+// CHECK-CC1-ARC-NEXT: {TypedText nullable}
// CHECK-CC1-ARC-NEXT: {TypedText readonly}
// CHECK-CC1-ARC-NEXT: {TypedText readwrite}
// CHECK-CC1-ARC-NEXT: {TypedText retain}
@@ -38,6 +46,10 @@
// RUN: c-index-test -code-completion-at=%s:8:18 %s | FileCheck -check-prefix=CHECK-CC2 %s
// CHECK-CC2: {TypedText getter}{Text =}{Placeholder method}
// CHECK-CC2-NEXT: {TypedText nonatomic}
+// CHECK-CC2-NEXT: {TypedText nonnull}
+// CHECK-CC2-NEXT: {TypedText null_resettable}
+// CHECK-CC2-NEXT: {TypedText null_unspecified}
+// CHECK-CC2-NEXT: {TypedText nullable}
// CHECK-CC2-NEXT: {TypedText readonly}
// CHECK-CC2-NEXT: {TypedText readwrite}
// CHECK-CC2-NEXT: {TypedText setter}{Text =}{Placeholder method}
diff --git a/test/Index/complete-stmt.c b/test/Index/complete-stmt.c
index 3d31ca2f908a..8bbfe2db56d8 100644
--- a/test/Index/complete-stmt.c
+++ b/test/Index/complete-stmt.c
@@ -16,6 +16,8 @@ void f(int x) {
// CHECK-IF-ELSE-SIMPLE: NotImplemented:{TypedText else}{HorizontalSpace }{Text if}{HorizontalSpace }{LeftParen (}{Placeholder expression}{RightParen )} (40)
// RUN: c-index-test -code-completion-at=%s:6:1 %s | FileCheck -check-prefix=CHECK-STMT %s
+// CHECK-STMT: NotImplemented:{TypedText __nonnull} (50)
+// CHECK-STMT: NotImplemented:{TypedText __nullable} (50)
// CHECK-STMT: NotImplemented:{TypedText char} (50)
// CHECK-STMT: NotImplemented:{TypedText const} (50)
// CHECK-STMT: NotImplemented:{TypedText double} (50)
diff --git a/test/Index/pch-depending-on-deleted-module.c b/test/Index/pch-depending-on-deleted-module.c
index 4e85ff0f96b9..a0fbaf559fca 100644
--- a/test/Index/pch-depending-on-deleted-module.c
+++ b/test/Index/pch-depending-on-deleted-module.c
@@ -3,11 +3,11 @@
// RUN: rm -rf %t
// RUN: mkdir %t
-// RUN: %clang_cc1 -x c-header -fmodules -fdisable-module-hash -fmodules-cache-path=%t/modules-cache -emit-pch -I %S/Inputs/Headers -o %t/use_LibA.pch %s
-// RUN: %clang_cc1 -fmodules -fdisable-module-hash -fmodules-cache-path=%t/modules-cache -I %S/Inputs/Headers -verify-pch %t/use_LibA.pch
+// RUN: %clang_cc1 -x c-header -fmodules -fimplicit-module-maps -fdisable-module-hash -fmodules-cache-path=%t/modules-cache -emit-pch -I %S/Inputs/Headers -o %t/use_LibA.pch %s
+// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fdisable-module-hash -fmodules-cache-path=%t/modules-cache -I %S/Inputs/Headers -verify-pch %t/use_LibA.pch
// RUN: rm -f %t/modules-cache/LibA.pcm
-// RUN: not %clang_cc1 -fmodules -fdisable-module-hash -fmodules-cache-path=%t/modules-cache -I %S/Inputs/Headers -verify-pch %t/use_LibA.pch 2>&1 | FileCheck -check-prefix=VERIFY %s
-// RUN: not c-index-test -test-load-source all -x c -fmodules -Xclang -fdisable-module-hash -fmodules-cache-path=%t/modules-cache -I %S/Inputs/Headers -include-pch %t/use_LibA.pch %s 2>&1 | FileCheck -check-prefix=INDEX %s
+// RUN: not %clang_cc1 -fmodules -fimplicit-module-maps -fdisable-module-hash -fmodules-cache-path=%t/modules-cache -I %S/Inputs/Headers -verify-pch %t/use_LibA.pch 2>&1 | FileCheck -check-prefix=VERIFY %s
+// RUN: not c-index-test -test-load-source all -x c -fmodules -fimplicit-module-maps -Xclang -fdisable-module-hash -fmodules-cache-path=%t/modules-cache -I %S/Inputs/Headers -include-pch %t/use_LibA.pch %s 2>&1 | FileCheck -check-prefix=INDEX %s
// VERIFY: fatal error: malformed or corrupted AST file: 'Unable to load module
// INDEX: {{^}}Failure: AST deserialization error occurred{{$}}