summaryrefslogtreecommitdiff
path: root/gcc/testsuite/objc/execute/bycopy-2.m
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/objc/execute/bycopy-2.m')
-rw-r--r--gcc/testsuite/objc/execute/bycopy-2.m30
1 files changed, 30 insertions, 0 deletions
diff --git a/gcc/testsuite/objc/execute/bycopy-2.m b/gcc/testsuite/objc/execute/bycopy-2.m
new file mode 100644
index 000000000..840881f4a
--- /dev/null
+++ b/gcc/testsuite/objc/execute/bycopy-2.m
@@ -0,0 +1,30 @@
+/*
+ * Contributed by Nicola Pero <nicola@brainstorm.co.uk>
+ * Fri Feb 2 11:48:01 GMT 2001
+ */
+
+#include "../../objc-obj-c++-shared/Protocol1.h"
+
+@protocol MyProtocol
++ (bycopy id<MyProtocol>) bycopyMethod;
+@end
+
+@interface MyObject : Object <MyProtocol>
+@end
+
+@implementation MyObject
++ (bycopy id<MyProtocol>) bycopyMethod
+{
+ return [MyObject alloc];
+}
+@end
+
+int main (void)
+{
+ MyObject *object;
+
+ object = [MyObject bycopyMethod];
+
+ exit (0);
+}
+#include "../../objc-obj-c++-shared/Object1-implementation.h"