2 using System.Collections.Generic;
3 using System.Reflection;
4 using System.Runtime.InteropServices;
5 using System.Runtime.CompilerServices;
8 * Regression tests for the mixed-mode execution.
9 * Run with --interp=jit=JitClass
22 [MethodImplAttribute (MethodImplOptions.NoInlining)]
23 public static void entry_void_0 () {
26 [MethodImplAttribute (MethodImplOptions.NoInlining)]
27 public static int entry_int_int (int i) {
31 [MethodImplAttribute (MethodImplOptions.NoInlining)]
32 public int entry_int_this_int (int i) {
36 [MethodImplAttribute (MethodImplOptions.NoInlining)]
37 public static string entry_string_string (string s1, string s2) {
41 [MethodImplAttribute (MethodImplOptions.NoInlining)]
42 public static AStruct entry_struct_struct (AStruct l) {
46 [MethodImplAttribute (MethodImplOptions.NoInlining)]
47 public static List<string> entry_ginst_ginst (List<string> l) {
51 [MethodImplAttribute (MethodImplOptions.NoInlining)]
52 public static GStruct<string> entry_ginst_ginst_vtype (GStruct<string> l) {
56 [MethodImplAttribute (MethodImplOptions.NoInlining)]
57 public static void entry_void_byref_int (ref int i) {
61 [MethodImplAttribute (MethodImplOptions.NoInlining)]
62 public static int entry_8_int_args (int i1, int i2, int i3, int i4, int i5, int i6, int i7, int i8) {
63 return i1 + i2 + i3 + i4 + i5 + i6 + i7 + i8;
66 [MethodImplAttribute (MethodImplOptions.NoInlining)]
67 public static int entry_9_int_args (int i1, int i2, int i3, int i4, int i5, int i6, int i7, int i8, int i9) {
68 return i1 + i2 + i3 + i4 + i5 + i6 + i7 + i8 + i9;
71 [MethodImplAttribute (MethodImplOptions.NoInlining)]
72 public static IntPtr entry_intptr_intptr (IntPtr i) {
78 /* The methods in this class will always be JITted */
81 [MethodImplAttribute (MethodImplOptions.NoInlining)]
82 public static int entry () {
83 InterpClass.entry_void_0 ();
84 InterpClass.entry_void_0 ();
85 int res = InterpClass.entry_int_int (1);
88 var c = new InterpClass ();
89 res = c.entry_int_this_int (1);
92 var s = InterpClass.entry_string_string ("A", "B");
95 var astruct = new AStruct () { i = 1 };
96 var astruct2 = InterpClass.entry_struct_struct (astruct);
99 var l = new List<string> ();
100 var l2 = InterpClass.entry_ginst_ginst (l);
103 var gstruct = new GStruct<string> () { i = 1 };
104 var gstruct2 = InterpClass.entry_ginst_ginst_vtype (gstruct);
108 InterpClass.entry_void_byref_int (ref val);
111 res = InterpClass.entry_8_int_args (1, 2, 3, 4, 5, 6, 7, 8);
114 res = InterpClass.entry_9_int_args (1, 2, 3, 4, 5, 6, 7, 8, 9);
117 var ptr = new IntPtr (32);
118 var ptr2 = InterpClass.entry_intptr_intptr (ptr);
124 [MethodImplAttribute (MethodImplOptions.NoInlining)]
125 public static AStruct exit_vtype (AStruct s) {
129 [MethodImplAttribute (MethodImplOptions.NoInlining)]
130 public static List<string> exit_ginst (List<string> l) {
134 [MethodImplAttribute (MethodImplOptions.NoInlining)]
135 public static GStruct<string> exit_ginst_vtype (GStruct<string> l) {
139 [MethodImplAttribute (MethodImplOptions.NoInlining)]
140 public static void exit_byref (ref int i) {
153 public static int Main (string[] args) {
154 return TestDriver.RunTests (typeof (Tests), args);
158 public static int test_0_entry () {
159 // This does an interp->jit transition
160 return JitClass.entry ();
163 public static int test_0_exit () {
164 var astruct = new AStruct () { i = 1};
165 var astruct2 = JitClass.exit_vtype (astruct);
168 var ginst = new List<string> ();
169 var ginst2 = JitClass.exit_ginst (ginst);
172 var gstruct = new GStruct<string> () { i = 1 };
173 var gstruct2 = JitClass.exit_ginst_vtype (gstruct);
177 JitClass.exit_byref (ref anint);