2 /* See if -forward::/-performv:: is able to work. */
3 /* { dg-xfail-run-if "PR36610" { ! { { i?86-*-* x86_64-*-* } && ilp32 } } { "-fgnu-runtime" } { "" } } */
4 /* { dg-skip-if "Needs OBJC2 Implementation" { *-*-darwin* && { lp64 } } { "-fnext-runtime" } { "" } } */
5 /* There is no implementation of forward: in the NeXT m64 libobjc/Object
6 neither have we implemented this in our extensions - so we have to skip it
12 #ifndef __NEXT_RUNTIME__
13 # include <objc/objc-api.h>
15 #include <objc/Object.h>
17 #define VALUETOUSE 1234567890
19 id forwarder, receiver;
21 @interface Forwarder: Object
26 -initWithReceiver:theReceiver;
30 @interface Receiver:Object
35 -initWithFoo:(int)theFoo;
37 @implementation Receiver
39 -initWithFoo: (int)theFoo
47 /* Check to see if we are really the reciever. */
50 /* And the value of foo is set correctly. */
51 if (foo != VALUETOUSE)
58 @implementation Forwarder
59 -initWithReceiver: theReceiver
62 receiver = theReceiver;
65 #ifdef __NEXT_RUNTIME__
66 - forward: (SEL)theSel: (marg_list)theArgFrame
68 -(retval_t) forward: (SEL)theSel: (arglist_t)theArgFrame
71 /* If we have a reciever try to perform on that object */
73 return [receiver performv: theSel: theArgFrame];
75 /* Normally you'd emit an error here. */
76 printf ("Unrecognized selector\n");
81 /* Init the reciever. */
82 receiver = [[Receiver alloc] initWithFoo: VALUETOUSE];
83 /* Init the fowarder. */
84 forwarder = [[Forwarder alloc] initWithReceiver: receiver];
85 /* Call display on the forwarder which in turns calls display on