summaryrefslogtreecommitdiffstats
path: root/test/SemaObjC
diff options
context:
space:
mode:
authorrdivacky <rdivacky@FreeBSD.org>2010-01-15 15:39:40 +0000
committerrdivacky <rdivacky@FreeBSD.org>2010-01-15 15:39:40 +0000
commita3fa5c7f1b5e2ba4d6ec033dc0e2376326b05824 (patch)
treea6082d4d1d1e9ddaea09a6a04bb4a47da95d642d /test/SemaObjC
parentbb1e3bc1e0be2b8f891db46457a8943451bf4d8b (diff)
downloadFreeBSD-src-a3fa5c7f1b5e2ba4d6ec033dc0e2376326b05824.zip
FreeBSD-src-a3fa5c7f1b5e2ba4d6ec033dc0e2376326b05824.tar.gz
Update clang to r93512.
Diffstat (limited to 'test/SemaObjC')
-rw-r--r--test/SemaObjC/bad-receiver-1.m2
-rw-r--r--test/SemaObjC/category-1.m2
-rw-r--r--test/SemaObjC/continuation-class-property.m24
-rw-r--r--test/SemaObjC/ivar-access-package.m2
-rw-r--r--test/SemaObjC/ivar-lookup-resolution-builtin.m40
-rw-r--r--test/SemaObjC/nonnull.m3
-rw-r--r--test/SemaObjC/property-9.m12
-rw-r--r--test/SemaObjC/protocol-archane.m1
-rw-r--r--test/SemaObjC/undef-class-messagin-error.m6
-rw-r--r--test/SemaObjC/undef-superclass-1.m5
10 files changed, 92 insertions, 5 deletions
diff --git a/test/SemaObjC/bad-receiver-1.m b/test/SemaObjC/bad-receiver-1.m
index 094c12f..33e1630 100644
--- a/test/SemaObjC/bad-receiver-1.m
+++ b/test/SemaObjC/bad-receiver-1.m
@@ -4,6 +4,8 @@
- (id) retain;
@end
+int objc_lookUpClass(const char*);
+
void __raiseExc1() {
[objc_lookUpClass("NSString") retain]; // expected-warning {{receiver type 'int' is not 'id'}} \
expected-warning {{method '-retain' not found}}
diff --git a/test/SemaObjC/category-1.m b/test/SemaObjC/category-1.m
index 17c6b46..33e4646 100644
--- a/test/SemaObjC/category-1.m
+++ b/test/SemaObjC/category-1.m
@@ -29,7 +29,7 @@
@interface MyClass1 (Category) <p2, p3> @end // expected-warning {{cannot find protocol definition for 'p2'}}
-@interface MyClass (Category) @end // expected-error {{cannot find interface declaration for 'MyClass'}}
+@interface UnknownClass (Category) @end // expected-error {{cannot find interface declaration for 'UnknownClass'}}
@class MyClass2;
diff --git a/test/SemaObjC/continuation-class-property.m b/test/SemaObjC/continuation-class-property.m
new file mode 100644
index 0000000..c48a23d
--- /dev/null
+++ b/test/SemaObjC/continuation-class-property.m
@@ -0,0 +1,24 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+// radar 7509234
+
+@protocol Foo
+@property (readonly, copy) id foos;
+@end
+
+@interface Bar <Foo> {
+}
+
+@end
+
+@interface Baz <Foo> {
+}
+@end
+
+@interface Bar ()
+@property (readwrite, copy) id foos;
+@end
+
+@interface Baz ()
+@property (readwrite, copy) id foos;
+@end
+
diff --git a/test/SemaObjC/ivar-access-package.m b/test/SemaObjC/ivar-access-package.m
index 956ae5b..abc3420 100644
--- a/test/SemaObjC/ivar-access-package.m
+++ b/test/SemaObjC/ivar-access-package.m
@@ -34,6 +34,8 @@ typedef unsigned char BOOL;
}
@end
+void NSLog(id, ...);
+
int main (int argc, const char * argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
A *a = [[A new] autorelease];
diff --git a/test/SemaObjC/ivar-lookup-resolution-builtin.m b/test/SemaObjC/ivar-lookup-resolution-builtin.m
new file mode 100644
index 0000000..2e90e8e
--- /dev/null
+++ b/test/SemaObjC/ivar-lookup-resolution-builtin.m
@@ -0,0 +1,40 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+// pr5986
+
+@interface Test {
+ int index;
+}
+- (int) index;
++ (int) ClassMethod;
+@end
+
+@implementation Test
+- (int) index
+{
+ return index;
+}
++ (int) ClassMethod
+{
+ return index; // expected-error {{instance variable 'index' accessed in class method}}
+}
+@end
+
+@interface Test1 {
+}
+- (int) InstMethod;
++ (int) ClassMethod;
+@end
+
+@implementation Test1
+- (int) InstMethod
+{
+ return index; // expected-warning {{implicitly declaring C library function 'index'}} \
+ // expected-note {{please include the header <strings.h> or explicitly provide a declaration for 'index'}} \
+ // expected-warning {{incompatible pointer to integer conversion returning}}
+}
++ (int) ClassMethod
+{
+ return index; // expected-warning {{incompatible pointer to integer conversion returning}}
+}
+@end
+
diff --git a/test/SemaObjC/nonnull.m b/test/SemaObjC/nonnull.m
index c96a91a..642f50f 100644
--- a/test/SemaObjC/nonnull.m
+++ b/test/SemaObjC/nonnull.m
@@ -19,6 +19,9 @@ __attribute__((nonnull(1,3)));
extern void func4 (void (^block1)(), void (^block2)()) __attribute__((nonnull(1)))
__attribute__((nonnull(2)));
+void func6();
+void func7();
+
void
foo (int i1, int i2, int i3, void (^cp1)(), void (^cp2)(), void (^cp3)())
{
diff --git a/test/SemaObjC/property-9.m b/test/SemaObjC/property-9.m
index 138f099..d527a9c 100644
--- a/test/SemaObjC/property-9.m
+++ b/test/SemaObjC/property-9.m
@@ -84,3 +84,15 @@ typedef signed char BOOL;
view.inEyeDropperMode = 1;
}
@end
+
+// radar 7427072
+@interface MyStyleIntf
+{
+ int _myStyle;
+}
+
+@property(readonly) int myStyle;
+
+- (float)setMyStyle:(int)style;
+@end
+
diff --git a/test/SemaObjC/protocol-archane.m b/test/SemaObjC/protocol-archane.m
index 108a729..138c43d 100644
--- a/test/SemaObjC/protocol-archane.m
+++ b/test/SemaObjC/protocol-archane.m
@@ -5,6 +5,7 @@
- (void) bar;
@end
+void bar();
void foo(id x) {
bar((short<SomeProtocol>)x); // expected-error {{expected ')'}} expected-note {{to match this '('}}
bar((<SomeProtocol>)x); // expected-warning {{protocol qualifiers without 'id' is archaic}}
diff --git a/test/SemaObjC/undef-class-messagin-error.m b/test/SemaObjC/undef-class-messagin-error.m
index 0a400dd..63e0b9d 100644
--- a/test/SemaObjC/undef-class-messagin-error.m
+++ b/test/SemaObjC/undef-class-messagin-error.m
@@ -1,13 +1,13 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s
-@interface _Child
+@interface _Child // expected-note{{'_Child' declared here}}
+ (int) flashCache;
@end
-@interface Child (Categ) // expected-error {{cannot find interface declaration for 'Child'}}
+@interface Child (Categ) // expected-error {{cannot find interface declaration for 'Child'; did you mean '_Child'?}}
+ (int) flushCache2;
@end
-@implementation Child (Categ) // expected-error {{cannot find interface declaration for 'Child'}}
+@implementation OtherChild (Categ) // expected-error {{cannot find interface declaration for 'OtherChild'}}
+ (int) flushCache2 { [super flashCache]; } // expected-error {{no @interface declaration found in class messaging of 'flushCache2'}}
@end
diff --git a/test/SemaObjC/undef-superclass-1.m b/test/SemaObjC/undef-superclass-1.m
index 7611cf3..0c2594c 100644
--- a/test/SemaObjC/undef-superclass-1.m
+++ b/test/SemaObjC/undef-superclass-1.m
@@ -13,7 +13,8 @@
@interface INTF2 : INTF1
@end
-@interface INTF3 : Y // expected-error {{cannot find interface declaration for 'Y', superclass of 'INTF3'}}
+@interface INTF3 : Y // expected-error {{cannot find interface declaration for 'Y', superclass of 'INTF3'}} \
+ // expected-note{{'INTF3' declared here}}
@end
@interface INTF1 // expected-error {{duplicate interface definition for class 'INTF1'}}
@@ -31,3 +32,5 @@
@implementation RecursiveClass
@end
+@implementation iNTF3 // expected-warning{{cannot find interface declaration for 'iNTF3'; did you mean 'INTF3'?}}
+@end
OpenPOWER on IntegriCloud