summaryrefslogtreecommitdiff
path: root/gcc/testsuite/objc.dg/class-extension-3.m
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/objc.dg/class-extension-3.m')
-rw-r--r--gcc/testsuite/objc.dg/class-extension-3.m26
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc/testsuite/objc.dg/class-extension-3.m b/gcc/testsuite/objc.dg/class-extension-3.m
new file mode 100644
index 000000000..69e570539
--- /dev/null
+++ b/gcc/testsuite/objc.dg/class-extension-3.m
@@ -0,0 +1,26 @@
+/* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, December 2010. */
+/* { dg-do compile } */
+
+/* This test tests warnings on class extensions. */
+
+#include <objc/objc.h>
+
+@interface MyObject
+{
+ Class isa;
+ int count;
+}
+- (int) test; /* { dg-message "previous declaration" } */
+@property int count; /* { dg-message "originally specified here" } */
+@end
+
+@interface MyObject ()
+- (void) test; /* { dg-error "duplicate declaration of method .-test." } */
+@end
+
+@interface MyObject ()
+@end
+
+@interface MyObject ()
+@property int count; /* { dg-error "redeclaration of property .count." } */
+@end