using System.Runtime.CompilerServices;
using System.Reflection.Emit;
-public class Tests {
+public unsafe class Tests {
public int int_field;
return mono_test_stdcall_name_mangling (0, 1, 2) == 3 ? 0 : 1;
}
+ /* Test multiple calls to stdcall wrapper, xamarin bug 30146 */
+ public static int test_0_stdcall_many_calls () {
+ for (int i=0; i<256; i++)
+ mono_test_stdcall_name_mangling (0, 0, 0);
+ return 0;
+ }
+
/* Float test */
[DllImport ("libtest", EntryPoint="mono_test_marshal_pass_return_float")]
else
return 0;
}
+
+ [StructLayout(LayoutKind.Explicit, Size = 12)]
+ public struct FixedArrayStruct {
+ [FieldOffset(0)]
+ public fixed int array[3];
+ }
+
+ [DllImport ("libtest", EntryPoint="mono_test_marshal_fixed_array")]
+ public static extern int mono_test_marshal_fixed_array (FixedArrayStruct s);
+
+ public static unsafe int test_6_fixed_array_struct () {
+ var s = new FixedArrayStruct ();
+ s.array [0] = 1;
+ s.array [1] = 2;
+ s.array [2] = 3;
+
+ return mono_test_marshal_fixed_array (s);
+ }
}