aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/objc.dg/super-class-4.m
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/objc.dg/super-class-4.m')
-rw-r--r--gcc/testsuite/objc.dg/super-class-4.m35
1 files changed, 35 insertions, 0 deletions
diff --git a/gcc/testsuite/objc.dg/super-class-4.m b/gcc/testsuite/objc.dg/super-class-4.m
new file mode 100644
index 00000000000..0f6317beb50
--- /dev/null
+++ b/gcc/testsuite/objc.dg/super-class-4.m
@@ -0,0 +1,35 @@
+/* APPLE LOCAL file mainliine */
+/* Bail out gracefully if attempting to derive from a class that has only been
+ forward-declared (via @class). Conversely, @compatibility_alias declarations
+ should be traversed to find the @interface. */
+/* { dg-do compile } */
+
+#include <objc/Object.h>
+
+@class MyWpModule;
+
+@compatibility_alias MyObject Object;
+@compatibility_alias FictitiousModule MyWpModule;
+
+@protocol MySelTarget
+- (id) meth1;
+@end
+
+@protocol Img
+- (id) meth2;
+@end
+
+@interface FunnyModule: FictitiousModule <Img> /* { dg-error ".MyWpModule., superclass of .FunnyModule." } */
+- (id) meth2;
+@end
+
+@interface MyProjWpModule : MyWpModule <MySelTarget, Img> /* { dg-error ".MyWpModule., superclass of .MyProjWpModule." } */ {
+ id i1, i2;
+}
+- (id) meth1;
+- (id) meth2;
+@end
+
+@interface AnotherModule: MyObject <MySelTarget>
+- (id) meth1;
+@end