9 #define STDCALL __stdcall
15 extern __declspec(dllimport) __stdcall void CoTaskMemFree(void *ptr);
18 typedef int (STDCALL *SimpleDelegate) (int a);
20 static void marshal_free (void *ptr)
29 STDCALL unsigned short*
30 test_lpwstr_marshal (unsigned short* chars, long length)
35 res = malloc (2 * (length + 1));
37 // printf("test_lpwstr_marshal()\n");
39 while ( i < length ) {
40 // printf("X|%u|\n", chars[i]);
57 mono_union_test_1 (union_test_1_type u1) {
58 // printf ("Got values %d %d %d\n", u1.b, u1.a, u1.c);
59 return u1.a + u1.b + u1.c;
63 mono_return_int (int a) {
64 // printf ("Got value %d\n", a);
74 mono_return_int_ss (struct ss a) {
75 // printf ("Got value %d\n", a.i);
80 mono_return_ss (struct ss a) {
81 // printf ("Got value %d\n", a.i);
92 mono_return_sc1 (struct sc1 a) {
93 // printf ("Got value %d\n", a.c[0]);
105 mono_return_sc3 (struct sc3 a) {
106 // printf ("Got values %d %d %d\n", a.c[0], a.c[1], a.c[2]);
119 mono_return_sc5 (struct sc5 a) {
120 // printf ("Got values %d %d %d %d %d\n", a.c[0], a.c[1], a.c[2], a.c[3], a.c[4]);
136 mono_return_int_su (union su a) {
137 // printf ("Got value %d\n", a.i1);
142 mono_test_many_int_arguments (int a, int b, int c, int d, int e,
143 int f, int g, int h, int i, int j);
145 mono_test_many_short_arguments (short a, short b, short c, short d, short e,
146 short f, short g, short h, short i, short j);
148 mono_test_many_char_arguments (char a, char b, char c, char d, char e,
149 char f, char g, char h, char i, char j);
152 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)
154 return a + b + c + d + e + f + g + h + i + j;
158 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)
160 return a + b + c + d + e + f + g + h + i + j;
164 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)
166 return a + b + c + d + e + f + g + h + i + j;
170 mono_test_many_float_arguments (float a, float b, float c, float d, float e, float f, float g, float h, float i, float j)
172 return a + b + c + d + e + f + g + h + i + j;
176 mono_test_many_double_arguments (double a, double b, double c, double d, double e, double f, double g, double h, double i, double j)
178 return a + b + c + d + e + f + g + h + i + j;
182 mono_test_split_double_arguments (double a, double b, float c, double d, double e)
184 return a + b + c + d + e;
188 mono_test_puts_static (char *s)
190 // printf ("TEST %s\n", s);
194 typedef int (STDCALL *SimpleDelegate3) (int a, int b);
197 mono_invoke_delegate (SimpleDelegate3 delegate)
201 // printf ("start invoke %p\n", delegate);
203 res = delegate (2, 3);
205 // printf ("end invoke\n");
211 mono_test_marshal_char (short a1)
220 mono_test_marshal_char_array (gunichar2 *s)
222 const char m[] = "abcdef";
226 s2 = g_utf8_to_utf16 (m, -1, NULL, &len, NULL);
235 mono_test_empty_pinvoke (int i)
241 mono_test_marshal_bool_byref (int a, int *b, int c)
251 mono_test_marshal_array (int *a1)
255 for (i = 0; i < 50; i++)
262 mono_test_marshal_inout_array (int *a1)
266 for (i = 0; i < 50; i++) {
268 a1 [i] = 50 - a1 [i];
275 mono_test_marshal_inout_nonblittable_array (gunichar2 *a1)
279 for (i = 0; i < 10; i++) {
295 mono_test_return_vtype (int i)
298 static gunichar2 test2 [] = { 'T', 'E', 'S', 'T', '2', 0 };
310 mono_test_delegate_struct (void)
312 // printf ("TEST\n");
315 typedef char* (STDCALL *ReturnStringDelegate) (const char *s);
318 mono_test_return_string (ReturnStringDelegate func)
322 // printf ("mono_test_return_string\n");
327 // printf ("got string: %s\n", res);
328 return g_strdup ("12345");
331 typedef int (STDCALL *RefVTypeDelegate) (int a, simplestruct *ss, int b);
334 mono_test_ref_vtype (int a, simplestruct *ss, int b, RefVTypeDelegate func)
336 if (a == 1 && b == 2 && ss->a == 0 && ss->b == 1 && ss->c == 0 &&
337 !strcmp (ss->d, "TEST1")) {
343 return func (a, ss, b);
349 typedef int (STDCALL *OutVTypeDelegate) (int a, simplestruct *ss, int b);
352 mono_test_marshal_out_struct (int a, simplestruct *ss, int b, OutVTypeDelegate func)
354 /* Check that the input pointer is ignored */
355 ss->d = (gpointer)0x12345678;
359 if (ss->a && ss->b && ss->c && !strcmp (ss->d, "TEST3"))
367 SimpleDelegate func, func2;
370 STDCALL DelegateStruct
371 mono_test_marshal_delegate_struct (DelegateStruct ds)
375 res.a = ds.func (ds.a) + ds.func2 (ds.a);
377 res.func2 = ds.func2;
383 mono_test_marshal_struct (simplestruct ss)
385 if (ss.a == 0 && ss.b == 1 && ss.c == 0 &&
386 !strcmp (ss.d, "TEST"))
404 mono_test_marshal_struct2 (simplestruct2 ss)
406 if (ss.a == 0 && ss.b == 1 && ss.c == 0 &&
407 !strcmp (ss.d, "TEST") &&
408 ss.e == 99 && ss.f == 1.5 && ss.g == 42 && ss.h == (guint64)123)
414 /* on HP some of the struct should be on the stack and not in registers */
416 mono_test_marshal_struct2_2 (int i, int j, int k, simplestruct2 ss)
418 if (i != 10 || j != 11 || k != 12)
420 if (ss.a == 0 && ss.b == 1 && ss.c == 0 &&
421 !strcmp (ss.d, "TEST") &&
422 ss.e == 99 && ss.f == 1.5 && ss.g == 42 && ss.h == (guint64)123)
429 mono_test_marshal_struct_array (simplestruct2 *ss)
431 if (! (ss[0].a == 0 && ss[0].b == 1 && ss[0].c == 0 &&
432 !strcmp (ss[0].d, "TEST") &&
433 ss[0].e == 99 && ss[0].f == 1.5 && ss[0].g == 42 && ss[0].h == (guint64)123))
436 if (! (ss[1].a == 0 && ss[1].b == 0 && ss[1].c == 0 &&
437 !strcmp (ss[1].d, "TEST2") &&
438 ss[1].e == 100 && ss[1].f == 2.5 && ss[1].g == 43 && ss[1].h == (guint64)124))
444 typedef struct long_align_struct {
451 mono_test_marshal_long_align_struct_array (long_align_struct *ss)
453 return ss[0].a + ss[0].b + ss[0].c + ss[1].a + ss[1].b + ss[1].c;
456 STDCALL simplestruct2 *
457 mono_test_marshal_class (int i, int j, int k, simplestruct2 *ss, int l)
464 if (i != 10 || j != 11 || k != 12 || l != 14)
466 if (! (ss->a == 0 && ss->b == 1 && ss->c == 0 &&
467 !strcmp (ss->d, "TEST") &&
468 ss->e == 99 && ss->f == 1.5 && ss->g == 42 && ss->h == (guint64)123))
471 res = g_new0 (simplestruct2, 1);
472 memcpy (res, ss, sizeof (simplestruct2));
473 res->d = g_strdup ("TEST");
478 mono_test_marshal_byref_class (simplestruct2 **ssp)
480 simplestruct2 *ss = *ssp;
483 if (! (ss->a == 0 && ss->b == 1 && ss->c == 0 &&
484 !strcmp (ss->d, "TEST") &&
485 ss->e == 99 && ss->f == 1.5 && ss->g == 42 && ss->h == (guint64)123))
488 res = g_new0 (simplestruct2, 1);
489 memcpy (res, ss, sizeof (simplestruct2));
490 res->d = g_strdup ("TEST-RES");
507 reliable_delegate (int a)
513 * Checks whether get_sp() works as expected. It doesn't work with gcc-2.95.3 on linux.
516 is_get_sp_reliable (void)
520 reliable_delegate(1);
522 reliable_delegate(1);
528 mono_test_marshal_delegate (SimpleDelegate delegate)
532 /* Check that the delegate wrapper is stdcall */
537 if (is_get_sp_reliable())
538 g_assert (sp1 == sp2);
543 STDCALL SimpleDelegate
544 mono_test_marshal_return_delegate (SimpleDelegate delegate)
550 return_plus_one (int i)
555 STDCALL SimpleDelegate
556 mono_test_marshal_return_delegate_2 ()
558 return return_plus_one;
561 typedef simplestruct (STDCALL *SimpleDelegate2) (simplestruct ss);
564 is_utf16_equals (gunichar2 *s1, const char *s2)
569 s = g_utf16_to_utf8 (s1, -1, NULL, NULL, NULL);
570 res = strcmp (s, s2);
577 mono_test_marshal_delegate2 (SimpleDelegate2 delegate)
579 simplestruct ss, res;
585 ss.d2 = g_utf8_to_utf16 ("TEST2", -1, NULL, NULL, NULL);
588 if (! (res.a && !res.b && res.c && !strcmp (res.d, "TEST-RES") && is_utf16_equals (res.d2, "TEST2-RES")))
594 typedef simplestruct* (STDCALL *SimpleDelegate4) (simplestruct *ss);
597 mono_test_marshal_delegate4 (SimpleDelegate4 delegate)
608 res = delegate (&ss);
612 /* Check return value */
613 if (! (!res->a && res->b && !res->c && !strcmp (res->d, "TEST")))
616 /* Check NULL argument and NULL result */
617 res = delegate (NULL);
624 typedef int (STDCALL *SimpleDelegate5) (simplestruct **ss);
627 mono_test_marshal_delegate5 (SimpleDelegate5 delegate)
640 res = delegate (&ptr);
644 if (!(ptr->a && !ptr->b && ptr->c && !strcmp (ptr->d, "RES")))
651 mono_test_marshal_delegate6 (SimpleDelegate5 delegate)
655 res = delegate (NULL);
660 typedef int (STDCALL *SimpleDelegate7) (simplestruct **ss);
663 mono_test_marshal_delegate7 (SimpleDelegate7 delegate)
668 /* Check that the input pointer is ignored */
669 ptr = (gpointer)0x12345678;
671 res = delegate (&ptr);
675 if (!(ptr->a && !ptr->b && ptr->c && !strcmp (ptr->d, "RES")))
681 typedef int (STDCALL *SimpleDelegate8) (gunichar2 *s);
684 mono_test_marshal_delegate8 (SimpleDelegate8 delegate, gunichar2 *s)
689 typedef int (STDCALL *return_int_fnt) (int i);
690 typedef int (STDCALL *SimpleDelegate9) (return_int_fnt d);
693 mono_test_marshal_delegate9 (SimpleDelegate9 delegate, gpointer ftn)
695 return delegate (ftn);
705 mono_test_marshal_delegate10 (SimpleDelegate9 delegate)
707 return delegate (return_self);
710 typedef int (STDCALL *PrimitiveByrefDelegate) (int *i);
713 mono_test_marshal_primitive_byref_delegate (PrimitiveByrefDelegate delegate)
717 int res = delegate (&i);
727 typedef int (STDCALL *return_int_delegate) (int i);
729 typedef return_int_delegate (STDCALL *ReturnDelegateDelegate) (void);
732 mono_test_marshal_return_delegate_delegate (ReturnDelegateDelegate d)
738 mono_test_marshal_stringbuilder (char *s, int n)
740 const char m[] = "This is my message. Isn't it nice?";
742 if (strcmp (s, "ABCD") != 0)
749 mono_test_marshal_stringbuilder_unicode (gunichar2 *s, int n)
751 const char m[] = "This is my message. Isn't it nice?";
755 s2 = g_utf8_to_utf16 (m, -1, NULL, &len, NULL);
774 mono_test_marshal_empty_string_array (char **array)
776 return (array == NULL) ? 0 : 1;
780 mono_test_marshal_string_array (char **array)
782 if (strcmp (array [0], "ABC"))
784 if (strcmp (array [1], "DEF"))
787 if (array [2] != NULL)
794 mono_test_marshal_byref_string_array (char ***array)
799 if (strcmp ((*array) [0], "Alpha"))
801 if (strcmp ((*array) [1], "Beta"))
803 if (strcmp ((*array) [2], "Gamma"))
810 mono_test_marshal_stringbuilder_array (char **array)
812 if (strcmp (array [0], "ABC"))
814 if (strcmp (array [1], "DEF"))
817 strcpy (array [0], "DEF");
818 strcpy (array [1], "ABC");
824 mono_test_marshal_unicode_string_array (gunichar2 **array, char **array2)
826 GError *error = NULL;
829 s = g_utf16_to_utf8 (array [0], -1, NULL, NULL, &error);
830 if (strcmp (s, "ABC")) {
837 s = g_utf16_to_utf8 (array [1], -1, NULL, NULL, &error);
838 if (strcmp (s, "DEF")) {
845 if (strcmp (array2 [0], "ABC"))
848 if (strcmp (array2 [1], "DEF"))
854 /* this does not work on Redhat gcc 2.96 */
856 mono_test_empty_struct (int a, EmptyStruct es, int b)
858 // printf ("mono_test_empty_struct %d %d\n", a, b);
860 if (a == 1 && b == 2)
869 STDCALL ByValStrStruct *
870 mono_test_byvalstr_gen (void)
874 ret = malloc(sizeof(ByValStrStruct));
875 memset(ret, 'a', sizeof(ByValStrStruct)-1);
876 ret->a[sizeof(ByValStrStruct)-1] = 0;
882 mono_test_byvalstr_check (ByValStrStruct* data, char* correctString)
886 ret = strcmp(data->a, correctString);
887 // printf ("T1: %s\n", data->a);
888 // printf ("T2: %s\n", correctString);
895 NameManglingAnsi (char *data)
897 return data [0] + data [1] + data [2];
901 NameManglingAnsiA (char *data)
903 g_assert_not_reached ();
907 NameManglingAnsiW (char *data)
909 g_assert_not_reached ();
913 NameManglingAnsi2A (char *data)
915 return data [0] + data [1] + data [2];
919 NameManglingAnsi2W (char *data)
921 g_assert_not_reached ();
925 NameManglingUnicode (char *data)
927 g_assert_not_reached ();
931 NameManglingUnicodeW (gunichar2 *data)
933 return data [0] + data [1] + data [2];
937 NameManglingUnicode2 (gunichar2 *data)
939 return data [0] + data [1] + data [2];
943 NameManglingAutoW (char *data)
946 return (data [0] + data [1] + data [2]) == 131 ? 0 : 1;
948 g_assert_not_reached ();
953 NameManglingAuto (char *data)
956 return (data [0] + data [1] + data [2]) == 198 ? 0 : 1;
958 g_assert_not_reached ();
962 typedef int (STDCALL *intcharFunc)(const char*);
965 callFunction (intcharFunc f)
976 class_marshal_test0 (SimpleObj *obj1)
978 // printf ("class_marshal_test0 %s %d\n", obj1->str, obj1->i);
980 if (strcmp(obj1->str, "T1"))
989 class_marshal_test4 (SimpleObj *obj1)
998 class_marshal_test1 (SimpleObj **obj1)
1000 SimpleObj *res = malloc (sizeof (SimpleObj));
1002 res->str = g_strdup ("ABC");
1009 class_marshal_test2 (SimpleObj **obj1)
1011 // printf ("class_marshal_test2 %s %d\n", (*obj1)->str, (*obj1)->i);
1013 if (strcmp((*obj1)->str, "ABC"))
1015 if ((*obj1)->i != 5)
1022 string_marshal_test0 (char *str)
1024 if (strcmp (str, "TEST0"))
1031 string_marshal_test1 (const char **str)
1037 string_marshal_test2 (char **str)
1039 // printf ("string_marshal_test2 %s\n", *str);
1041 if (strcmp (*str, "TEST1"))
1048 string_marshal_test3 (char *str)
1062 TestVectorList (VectorList *vl)
1066 // printf ("TestVectorList %d %d\n", vl->a, vl->b);
1071 res = g_new0 (VectorList, 1);
1072 memcpy (res, vl, sizeof (VectorList));
1077 typedef struct _OSVERSIONINFO
1084 GetVersionEx (OSVERSIONINFO *osvi)
1087 // printf ("GOT %d %d\n", osvi->a, osvi->b);
1092 return osvi->a + osvi->b;
1096 BugGetVersionEx (int a, int b, int c, int d, int e, int f, int g, int h, OSVERSIONINFO *osvi)
1099 // printf ("GOT %d %d\n", osvi->a, osvi->b);
1104 return osvi->a + osvi->b;
1113 mono_test_marshal_point (point pt)
1115 // printf("point %g %g\n", pt.x, pt.y);
1116 if (pt.x == 1.25 && pt.y == 3.5)
1128 mono_test_marshal_mixed_point (mixed_point pt)
1130 // printf("mixed point %d %g\n", pt.x, pt.y);
1131 if (pt.x == 5 && pt.y == 6.75)
1138 mono_test_marshal_mixed_point_2 (mixed_point *pt)
1140 if (pt->x != 5 || pt->y != 6.75)
1150 marshal_test_ref_bool(int i, char *b1, short *b2, int *b3)
1153 if (*b1 != 0 && *b1 != 1)
1155 if (*b2 != 0 && *b2 != -1) /* variant_bool */
1157 if (*b3 != 0 && *b3 != 1)
1159 if (i == ((*b1 << 2) | (-*b2 << 1) | *b3))
1171 short b2; /* variant_bool */
1176 marshal_test_bool_struct(struct BoolStruct *s)
1179 if (s->b1 != 0 && s->b1 != 1)
1181 if (s->b2 != 0 && s->b2 != -1)
1183 if (s->b3 != 0 && s->b3 != 1)
1185 if (s->i == ((s->b1 << 2) | (-s->b2 << 1) | s->b3))
1194 extern __declspec(dllimport) __stdcall void SetLastError(int x);
1198 mono_test_last_error (int err)
1208 mono_test_asany (void *ptr, int what)
1212 return (*(int*)ptr == 5) ? 0 : 1;
1214 return strcmp (ptr, "ABC") == 0 ? 0 : 1;
1216 simplestruct2 ss = *(simplestruct2*)ptr;
1218 if (ss.a == 0 && ss.b == 1 && ss.c == 0 &&
1219 !strcmp (ss.d, "TEST") &&
1220 ss.e == 99 && ss.f == 1.5 && ss.g == 42 && ss.h == (guint64)123)
1226 GError *error = NULL;
1229 s = g_utf16_to_utf8 (ptr, -1, NULL, NULL, &error);
1230 if (!strcmp (s, "ABC")) {
1240 g_assert_not_reached ();
1247 * AMD64 marshalling tests.
1250 typedef struct amd64_struct1 {
1257 STDCALL amd64_struct1
1258 mono_test_marshal_amd64_pass_return_struct1 (amd64_struct1 s)
1268 typedef struct amd64_struct2 {
1273 STDCALL amd64_struct2
1274 mono_test_marshal_amd64_pass_return_struct2 (amd64_struct2 s)
1282 typedef struct amd64_struct3 {
1286 STDCALL amd64_struct3
1287 mono_test_marshal_amd64_pass_return_struct3 (amd64_struct3 s)
1294 typedef struct amd64_struct4 {
1298 STDCALL amd64_struct4
1299 mono_test_marshal_amd64_pass_return_struct4 (amd64_struct4 s)
1307 static guint32 custom_res [2];
1310 mono_test_marshal_pass_return_custom (int i, guint32 *ptr, int j)
1312 /* ptr will be freed by CleanupNative, so make a copy */
1313 custom_res [0] = 0; /* not allocated by AllocHGlobal */
1314 custom_res [1] = ptr [1];
1319 typedef void *(STDCALL *PassReturnPtrDelegate) (void *ptr);
1322 mono_test_marshal_pass_return_custom_in_delegate (PassReturnPtrDelegate del)
1336 /* FIXME: Freed with FreeHGlobal */
1344 typedef int (STDCALL *ReturnEnumDelegate) (int e);
1347 mono_test_marshal_return_enum_delegate (ReturnEnumDelegate func)
1357 typedef BlittableStruct (STDCALL *SimpleDelegate10) (BlittableStruct ss);
1360 mono_test_marshal_blittable_struct_delegate (SimpleDelegate10 delegate)
1362 BlittableStruct ss, res;
1369 res = delegate (ss);
1370 if (! ((res.a == -1) && (res.b == -2) && (res.c == -3) && (res.d == -55)))
1377 mono_test_stdcall_name_mangling (int a, int b, int c)
1383 * PASSING AND RETURNING SMALL STRUCTURES FROM DELEGATES TESTS
1390 typedef SmallStruct1 (STDCALL *SmallStructDelegate1) (SmallStruct1 ss);
1393 mono_test_marshal_small_struct_delegate1 (SmallStructDelegate1 delegate)
1395 SmallStruct1 ss, res;
1399 res = delegate (ss);
1400 if (! (res.i == -1))
1410 typedef SmallStruct2 (STDCALL *SmallStructDelegate2) (SmallStruct2 ss);
1413 mono_test_marshal_small_struct_delegate2 (SmallStructDelegate2 delegate)
1415 SmallStruct2 ss, res;
1420 res = delegate (ss);
1421 if (! ((res.i == -2) && (res.j == -3)))
1432 typedef SmallStruct3 (STDCALL *SmallStructDelegate3) (SmallStruct3 ss);
1435 mono_test_marshal_small_struct_delegate3 (SmallStructDelegate3 delegate)
1437 SmallStruct3 ss, res;
1442 res = delegate (ss);
1443 if (! ((res.i == -1) && (res.j == -2)))
1453 typedef SmallStruct4 (STDCALL *SmallStructDelegate4) (SmallStruct4 ss);
1456 mono_test_marshal_small_struct_delegate4 (SmallStructDelegate4 delegate)
1458 SmallStruct4 ss, res;
1462 res = delegate (ss);
1463 if (! (res.i == -1))
1473 typedef SmallStruct5 (STDCALL *SmallStructDelegate5) (SmallStruct5 ss);
1476 mono_test_marshal_small_struct_delegate5 (SmallStructDelegate5 delegate)
1478 SmallStruct5 ss, res;
1482 res = delegate (ss);
1483 if (! (res.i == -5))
1493 typedef SmallStruct6 (STDCALL *SmallStructDelegate6) (SmallStruct6 ss);
1496 mono_test_marshal_small_struct_delegate6 (SmallStructDelegate6 delegate)
1498 SmallStruct6 ss, res;
1503 res = delegate (ss);
1504 if (! ((res.i == -1) && (res.j == -2)))
1515 typedef SmallStruct7 (STDCALL *SmallStructDelegate7) (SmallStruct7 ss);
1518 mono_test_marshal_small_struct_delegate7 (SmallStructDelegate7 delegate)
1520 SmallStruct7 ss, res;
1525 res = delegate (ss);
1526 if (! ((res.i == -1) && (res.j == -2)))
1536 typedef SmallStruct8 (STDCALL *SmallStructDelegate8) (SmallStruct8 ss);
1539 mono_test_marshal_small_struct_delegate8 (SmallStructDelegate8 delegate)
1541 SmallStruct8 ss, res;
1545 res = delegate (ss);
1546 if (! ((res.i == -1.0)))
1556 typedef SmallStruct9 (STDCALL *SmallStructDelegate9) (SmallStruct9 ss);
1559 mono_test_marshal_small_struct_delegate9 (SmallStructDelegate9 delegate)
1561 SmallStruct9 ss, res;
1565 res = delegate (ss);
1566 if (! ((res.i == -1.0)))
1576 typedef SmallStruct10 (STDCALL *SmallStructDelegate10) (SmallStruct10 ss);
1579 mono_test_marshal_small_struct_delegate10 (SmallStructDelegate10 delegate)
1581 SmallStruct10 ss, res;
1586 res = delegate (ss);
1587 if (! ((res.i == -1.0) && (res.j == -2.0)))
1598 typedef SmallStruct11 (STDCALL *SmallStructDelegate11) (SmallStruct11 ss);
1601 mono_test_marshal_small_struct_delegate11 (SmallStructDelegate11 delegate)
1603 SmallStruct11 ss, res;
1608 res = delegate (ss);
1609 if (! ((res.i == -1.0) && (res.j == -2)))
1615 typedef int (STDCALL *ArrayDelegate) (int i, char *j, void *arr);
1618 mono_test_marshal_array_delegate (void *arr, int len, ArrayDelegate del)
1620 return del (len, NULL, arr);
1623 typedef int (*CdeclDelegate) (int i, int j);
1626 mono_test_marshal_cdecl_delegate (CdeclDelegate del)
1630 for (i = 0; i < 1000; ++i)