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");
93 mono_test_delegate_struct ()
98 typedef simplestruct (*ReturnVTypeDelegate) (simplestruct ss);
101 mono_test_return_vtype2 (ReturnVTypeDelegate func)
110 printf ("mono_test_return_vtype2\n");
114 printf ("UA: %d\n", res1.a);
115 printf ("UB: %d\n", res1.b);
116 printf ("UC: %d\n", res1.c);
117 printf ("UD: %s\n", res1.d);
122 typedef char* (*ReturnStringDelegate) (char *s);
125 mono_test_return_string (ReturnStringDelegate func)
129 printf ("mono_test_return_string\n");
133 printf ("got string: %s\n", res);
137 typedef int (*RefVTypeDelegate) (int a, simplestruct *ss, int b);
140 mono_test_ref_vtype (int a, simplestruct *ss, int b, RefVTypeDelegate func)
142 if (a == 1 && b == 2 && ss->a == 0 && ss->b == 1 && ss->c == 0 &&
143 !strcmp (ss->d, "TEST1")) {
149 return func (a, ss, b);
161 mono_test_marshal_delegate_struct (DelegateStruct ds)
163 return ds.func (ds.a);
167 mono_test_marshal_struct (simplestruct ss)
169 if (ss.a == 0 && ss.b == 1 && ss.c == 0 &&
170 !strcmp (ss.d, "TEST"))
177 typedef int (*SimpleDelegate) (int a);
180 mono_test_marshal_delegate (SimpleDelegate delegate)
185 typedef int (*SimpleDelegate2) (simplestruct ss);
188 mono_test_marshal_delegate2 (SimpleDelegate2 delegate)
198 printf ("Calling delegate from unmanaged code\n");
200 printf ("GOT %d\n", res);
206 mono_test_marshal_stringbuilder (char *s, int n)
208 const char m[] = "This is my message. Isn't it nice?";
216 /* this does not work on Redhat gcc 2.96 */
219 mono_test_empty_struct (int a, EmptyStruct es, int b)
221 if (a == 1 && b == 2)