This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
new Objective-C tests
- To: gcc-patches at gcc dot gnu dot org
- Subject: new Objective-C tests
- From: Ovidiu Predescu <ovidiu at cup dot hp dot com>
- Date: Tue, 06 Feb 2001 09:23:06 -0800
I've checked in two new Objective-C tests and modified one to fix an incorrect
syntax. Here is the ChangeLog entry and the patch:
Tue Feb 5 8:53:33 2001 Ovidiu Predescu <ovidiu@cup.hp.com>
* objc/execute/bycopy-1.m, bycopy-2.m: Added new tests from Nicola
Pero <nicola@brainstorm.co.uk>.
* objc/execute/fdecl.m: Declare foo as pointer to AClass.
Index: fdecl.m
===================================================================
RCS file: /cvs/gcc/egcs/gcc/testsuite/objc/execute/fdecl.m,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -u -r1.1 -r1.2
--- fdecl.m 2000/11/21 08:32:12 1.1
+++ fdecl.m 2001/02/05 16:43:32 1.2
@@ -5,7 +5,7 @@
@interface test
{
- AClass foo;
+ AClass *foo;
}
@end
diff -u /dev/null bycopy-1.m
--- /dev/null Mon Jan 29 21:26:10 2001
+++ bycopy-1.m Mon Feb 5 08:43:40 2001
@@ -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 -u /dev/null bycopy-2.m
--- /dev/null Mon Jan 29 21:26:10 2001
+++ bycopy-2.m Mon Feb 5 08:43:17 2001
@@ -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);
+}
+
+