summaryrefslogtreecommitdiff
path: root/gcc/testsuite/objc.dg/attributes/class-attribute-2.m
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/objc.dg/attributes/class-attribute-2.m')
-rw-r--r--gcc/testsuite/objc.dg/attributes/class-attribute-2.m25
1 files changed, 25 insertions, 0 deletions
diff --git a/gcc/testsuite/objc.dg/attributes/class-attribute-2.m b/gcc/testsuite/objc.dg/attributes/class-attribute-2.m
new file mode 100644
index 00000000000..3ab93ccdfc2
--- /dev/null
+++ b/gcc/testsuite/objc.dg/attributes/class-attribute-2.m
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+
+#include <objc/objc.h>
+#include "../../objc-obj-c++-shared/Object1.h"
+
+__attribute ((deprecated))
+@interface depobj : Object { /* { dg-warning "class attributes are not available in this version" } */
+@public
+ int ivar;
+}
+- (int) mth;
+@end
+
+__attribute ((deprecated))
+@implementation depobj /* { dg-warning "prefix attributes are ignored for implementations" } */
+-(int) mth { return ivar; }
+@end
+
+int foo (void)
+{
+ depobj *p = [depobj new]; /* dg - warning "deprecated" */
+
+ int q = p->ivar;
+ return [p mth];
+}