aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorNicola Pero <nicola.pero@meta-innovation.com>2010-10-18 23:32:10 +0000
committerNicola Pero <nicola@gcc.gnu.org>2010-10-18 23:32:10 +0000
commit2a613cffb13f4dbb2b2af79645573e526d3224c8 (patch)
tree6aa7aaf4edf2fc98278364c2ae3ee2a5ed447736 /gcc
parentda57d1b98f8ca9d1304fe66ff14315f12ce2a14f (diff)
downloadgcc-2a613cffb13f4dbb2b2af79645573e526d3224c8.zip
gcc-2a613cffb13f4dbb2b2af79645573e526d3224c8.tar.gz
gcc-2a613cffb13f4dbb2b2af79645573e526d3224c8.tar.bz2
In gcc/testsuite/: 2010-10-18 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/testsuite/: 2010-10-18 Nicola Pero <nicola.pero@meta-innovation.com> Merge from 'apple/trunk' branch on FSF servers. 2006-03-16 Fariborz Jahanian <fjahanian@apple.com> Radar 4293709 * objc.dg/proto-init-mimatch-1.m: New. * obj-c++.dg/proto-init-mimatch-1.mm: New. From-SVN: r165668
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/ChangeLog10
-rw-r--r--gcc/testsuite/obj-c++.dg/proto-init-mimatch-1.mm35
-rw-r--r--gcc/testsuite/objc.dg/proto-init-mimatch-1.m35
3 files changed, 80 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 2c64ae9..5cdd7d3 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,4 +1,14 @@
2010-10-18 Nicola Pero <nicola.pero@meta-innovation.com>
+
+ Merge from 'apple/trunk' branch on FSF servers.
+
+ 2006-03-16 Fariborz Jahanian <fjahanian@apple.com>
+
+ Radar 4293709
+ * objc.dg/proto-init-mimatch-1.m: New.
+ * obj-c++.dg/proto-init-mimatch-1.mm: New.
+
+2010-10-18 Nicola Pero <nicola.pero@meta-innovation.com>
Implemented parsing @synthesize and @dynamic for
Objective-C/Objective-C++.
diff --git a/gcc/testsuite/obj-c++.dg/proto-init-mimatch-1.mm b/gcc/testsuite/obj-c++.dg/proto-init-mimatch-1.mm
new file mode 100644
index 0000000..64e52e8
--- /dev/null
+++ b/gcc/testsuite/obj-c++.dg/proto-init-mimatch-1.mm
@@ -0,0 +1,35 @@
+/* Test to warn on protocol mismatch in a variety of initializations. */
+
+/* { dg-do compile } */
+
+typedef struct objc_class *Class;
+
+typedef struct objc_object {
+ Class isa;
+} *id;
+
+@protocol NSObject
+@end
+
+@interface NSObject <NSObject>
+@end
+
+@protocol NSCopying
+- (void)copyWithZone;
+@end
+
+@interface Foo:NSObject <NSCopying>
+@end
+
+
+extern id <NSObject> NSCopyObject();
+
+@implementation Foo
+- (void)copyWithZone {
+ Foo *copy = NSCopyObject(); /* { dg-warning "type \\'id <NSObject>\\' does not conform to the \\'NSCopying\\' protocol" } */
+
+ Foo<NSObject,NSCopying> *g = NSCopyObject(); /* { dg-warning "type \\'id <NSObject>\\' does not conform to the \\'NSCopying\\' protocol" } */
+
+ id<NSObject,NSCopying> h = NSCopyObject(); /* { dg-warning "type \\'id <NSObject>\\' does not conform to the \\'NSCopying\\' protocol" } */
+}
+@end
diff --git a/gcc/testsuite/objc.dg/proto-init-mimatch-1.m b/gcc/testsuite/objc.dg/proto-init-mimatch-1.m
new file mode 100644
index 0000000..64e52e8
--- /dev/null
+++ b/gcc/testsuite/objc.dg/proto-init-mimatch-1.m
@@ -0,0 +1,35 @@
+/* Test to warn on protocol mismatch in a variety of initializations. */
+
+/* { dg-do compile } */
+
+typedef struct objc_class *Class;
+
+typedef struct objc_object {
+ Class isa;
+} *id;
+
+@protocol NSObject
+@end
+
+@interface NSObject <NSObject>
+@end
+
+@protocol NSCopying
+- (void)copyWithZone;
+@end
+
+@interface Foo:NSObject <NSCopying>
+@end
+
+
+extern id <NSObject> NSCopyObject();
+
+@implementation Foo
+- (void)copyWithZone {
+ Foo *copy = NSCopyObject(); /* { dg-warning "type \\'id <NSObject>\\' does not conform to the \\'NSCopying\\' protocol" } */
+
+ Foo<NSObject,NSCopying> *g = NSCopyObject(); /* { dg-warning "type \\'id <NSObject>\\' does not conform to the \\'NSCopying\\' protocol" } */
+
+ id<NSObject,NSCopying> h = NSCopyObject(); /* { dg-warning "type \\'id <NSObject>\\' does not conform to the \\'NSCopying\\' protocol" } */
+}
+@end