summaryrefslogtreecommitdiff
path: root/gcc/testsuite/objc
diff options
context:
space:
mode:
authorovidiu <ovidiu@138bc75d-0d04-0410-961f-82ee72b054a4>2001-02-05 16:44:36 +0000
committerovidiu <ovidiu@138bc75d-0d04-0410-961f-82ee72b054a4>2001-02-05 16:44:36 +0000
commitbaad6cc15a92dadb11cbf4e7a7c6a160182379c5 (patch)
tree0236eb2da1f1b3011ae099c304c37fe323b90ad4 /gcc/testsuite/objc
parent5d138b2251d153ff129bc3420029f45b5150879d (diff)
downloadgcc-baad6cc15a92dadb11cbf4e7a7c6a160182379c5.tar.gz
Added.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@39459 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/objc')
-rw-r--r--gcc/testsuite/objc/execute/bycopy-1.m20
-rw-r--r--gcc/testsuite/objc/execute/bycopy-2.m33
2 files changed, 53 insertions, 0 deletions
diff --git a/gcc/testsuite/objc/execute/bycopy-1.m b/gcc/testsuite/objc/execute/bycopy-1.m
new file mode 100644
index 00000000000..83f4b270b8f
--- /dev/null
+++ b/gcc/testsuite/objc/execute/bycopy-1.m
@@ -0,0 +1,20 @@
+/*
+ * Contributed by Nicola Pero <nicola@brainstorm.co.uk>
+ * Fri Feb 2 11:48:01 GMT 2001
+ */
+
+#include <objc/objc.h>
+#include <objc/Protocol.h>
+
+@protocol MyProtocol
+- (bycopy id) bycopyMethod;
+@end
+
+int main (void)
+{
+ [nil bycopyMethod];
+
+ exit (0);
+}
+
+
diff --git a/gcc/testsuite/objc/execute/bycopy-2.m b/gcc/testsuite/objc/execute/bycopy-2.m
new file mode 100644
index 00000000000..dce028152a9
--- /dev/null
+++ b/gcc/testsuite/objc/execute/bycopy-2.m
@@ -0,0 +1,33 @@
+/*
+ * Contributed by Nicola Pero <nicola@brainstorm.co.uk>
+ * Fri Feb 2 11:48:01 GMT 2001
+ */
+
+#include <objc/objc.h>
+#include <objc/Object.h>
+#include <objc/Protocol.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);
+}
+
+