Require target lra in gcc.dg/pr108095.c
[official-gcc.git] / gcc / testsuite / objc.dg / threedotthree-abi-1.m
blob8c22850e094f5fe38d24bc5a73595da98f17acbc
1 /* This file tests that things are encoded using the gcc-3.3 ABI which is only
2    used by the NeXT runtime.  */
3 /* { dg-do run { target *-*-darwin* } } */
4 /* { dg-require-effective-target ilp32 } */
5 /* { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } */
6 /* { dg-additional-options "-Wno-objc-root-class" } */
8 #include <stdio.h>
9 #include <string.h>
10 #include "../objc-obj-c++-shared/runtime.h"
12 extern void abort();
14 @protocol CommonProtocol
16 -(oneway void)methodCall_On:(in bycopy id)someValue_On;
17 -(oneway void)methodCall_nO:(bycopy in id)someValue_nO;
19 -(oneway void)methodCall_Oo:(out bycopy id)someValue_Oo;
20 -(oneway void)methodCall_oO:(bycopy out id)someValue_oO;
22 -(oneway void)methodCall_rn:(in const id)someValue_rn;
24 -(oneway void)methodCall_oOn:(in bycopy out id)someValue_oOn;
26 @end
28 @interface ObjCClass <CommonProtocol>
33 @end
35 @implementation ObjCClass
36 -(oneway void)methodCall_On:(in bycopy id)someValue_On { }
37 -(oneway void)methodCall_nO:(bycopy in id)someValue_nO { }
39 -(oneway void)methodCall_Oo:(out bycopy id)someValue_Oo { }
40 -(oneway void)methodCall_oO:(bycopy out id)someValue_oO { }
42 -(oneway void)methodCall_rn:(in const id)someValue_rn { }
43 -(oneway void)methodCall_oOn:(in bycopy out id)someValue_oOn { }
44 @end
46 Protocol *proto = @protocol(CommonProtocol);
47 struct objc_method_description *meth;
48 struct objc_method_description meth_object;
50 int main()
52         meth_object = protocol_getMethodDescription (proto, @selector(methodCall_On:), YES, YES);
53         meth = &meth_object;
54         if (strcmp (meth->types, "Vv12@0:4On@8"))
55           abort();
56         meth_object = protocol_getMethodDescription (proto, @selector(methodCall_nO:), YES, YES);
57         meth = &meth_object;
58         if (strcmp (meth->types, "Vv12@0:4nO@8"))
59           abort();
60         meth_object = protocol_getMethodDescription (proto, @selector(methodCall_Oo:), YES, YES);
61         meth = &meth_object;
62         if (strcmp (meth->types, "Vv12@0:4Oo@8"))
63           abort();
64         meth_object = protocol_getMethodDescription (proto, @selector(methodCall_oO:), YES, YES);
65         meth = &meth_object;
66         if (strcmp (meth->types, "Vv12@0:4oO@8"))
67           abort();
68         meth_object = protocol_getMethodDescription (proto, @selector(methodCall_rn:), YES, YES);
69         meth = &meth_object;
70         if (strcmp (meth->types, "Vv12@0:4rn@8"))
71           abort();
72         meth_object = protocol_getMethodDescription (proto, @selector(methodCall_oOn:), YES, YES);
73         meth = &meth_object;
74         if (strcmp (meth->types, "Vv12@0:4oOn@8"))
75           abort();
76         return 0;