4 int mono_test_many_int_arguments (int a, int b, int c, int d, int e,
5 int f, int g, int h, int i, int j);
6 short mono_test_many_short_arguments (short a, short b, short c, short d, short e,
7 short f, short g, short h, short i, short j);
8 char mono_test_many_char_arguments (char a, char b, char c, char d, char e,
9 char f, char g, char h, char i, char j);
12 mono_test_many_int_arguments (int a, int b, int c, int d, int e, int f, int g, int h, int i, int j)
14 return a + b + c + d + e + f + g + h + i + j;
18 mono_test_many_short_arguments (short a, short b, short c, short d, short e, short f, short g, short h, short i, short j)
20 return a + b + c + d + e + f + g + h + i + j;
24 mono_test_many_byte_arguments (char a, char b, char c, char d, char e, char f, char g, char h, char i, char j)
26 return a + b + c + d + e + f + g + h + i + j;
30 mono_test_puts_static (char *s)
32 printf ("TEST %s\n", s);
36 typedef int (*SimpleDelegate3) (int a, int b);
39 mono_invoke_delegate (SimpleDelegate3 delegate)
43 printf ("start invoke %p\n", delegate);
45 res = delegate (2, 3);
47 printf ("end invoke\n");
53 mono_test_marshal_char (short a1)
62 mono_test_marshal_array (int *a1)
66 for (i = 0; i < 50; i++)
80 mono_test_return_vtype ()
88 printf ("mono_test_return_vtype\n");
92 typedef simplestruct (*ReturnVTypeDelegate) (simplestruct ss);
95 mono_test_return_vtype2 (ReturnVTypeDelegate func)
104 printf ("mono_test_return_vtype2\n");
108 printf ("UA: %d\n", res1.a);
109 printf ("UB: %d\n", res1.b);
110 printf ("UC: %d\n", res1.c);
111 printf ("UD: %s\n", res1.d);
116 typedef char* (*ReturnStringDelegate) (char *s);
119 mono_test_return_string (ReturnStringDelegate func)
123 printf ("mono_test_return_string\n");
127 printf ("got string: %s\n", res);
131 typedef int (*RefVTypeDelegate) (int a, simplestruct *ss, int b);
134 mono_test_ref_vtype (int a, simplestruct *ss, int b, RefVTypeDelegate func)
136 if (a == 1 && b == 2 && ss->a == 0 && ss->b == 1 && ss->c == 0 &&
137 !strcmp (ss->d, "TEST1")) {
143 return func (a, ss, b);
155 mono_test_marshal_delegate_struct (DelegateStruct ds)
157 return ds.func (ds.a);
161 mono_test_marshal_struct (simplestruct ss)
163 if (ss.a == 0 && ss.b == 1 && ss.c == 0 &&
164 !strcmp (ss.d, "TEST"))
171 typedef int (*SimpleDelegate) (int a);
174 mono_test_marshal_delegate (SimpleDelegate delegate)
179 typedef int (*SimpleDelegate2) (simplestruct ss);
182 mono_test_marshal_delegate2 (SimpleDelegate2 delegate)
192 printf ("Calling delegate from unmanaged code\n");
194 printf ("GOT %d\n", res);
200 mono_test_marshal_stringbuilder (char *s, int n)
202 const char m[] = "This is my message. Isn't it nice?";
210 /* this does not work on Redhat gcc 2.96 */
213 mono_test_empty_struct (int a, EmptyStruct es, int b)
215 if (a == 1 && b == 2)