summaryrefslogtreecommitdiff
path: root/gcc/testsuite/obj-c++.dg/enhanced-proto-1.mm
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/obj-c++.dg/enhanced-proto-1.mm')
-rw-r--r--gcc/testsuite/obj-c++.dg/enhanced-proto-1.mm18
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/testsuite/obj-c++.dg/enhanced-proto-1.mm b/gcc/testsuite/obj-c++.dg/enhanced-proto-1.mm
new file mode 100644
index 000000000..97e14206b
--- /dev/null
+++ b/gcc/testsuite/obj-c++.dg/enhanced-proto-1.mm
@@ -0,0 +1,18 @@
+/* Test use of @optional/@required keywords in @protocol class. */
+/* { dg-do compile } */
+
+@protocol MyProto1
+@optional
+- (void) FOO;
+@optional
+- (void) FOO;
+@required
+- (void) REQ;
+@optional
+@end
+
+@protocol MyProto2 <MyProto1>
+- (void) FOO2;
+@optional
+- (void) FOO3;
+@end