OSDN Git Service

dce028152a96fe459b5c10ccbfbfa3610cf0408f
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / objc / execute / bycopy-2.m
1 /*
2  * Contributed by Nicola Pero <nicola@brainstorm.co.uk>
3  * Fri Feb  2 11:48:01 GMT 2001
4  */
5
6 #include <objc/objc.h>
7 #include <objc/Object.h>
8 #include <objc/Protocol.h>
9
10 @protocol MyProtocol
11 + (bycopy id<MyProtocol>) bycopyMethod;
12 @end
13
14 @interface MyObject : Object <MyProtocol> 
15 @end
16
17 @implementation MyObject
18 + (bycopy id<MyProtocol>) bycopyMethod
19 {
20   return [MyObject alloc];
21 }
22 @end
23
24 int main (void)
25 {
26   MyObject *object;
27
28   object = [MyObject bycopyMethod];
29
30    exit (0);
31 }
32
33