4 * Application program used by the debugger tests.
7 using System.Runtime.CompilerServices;
8 using System.Reflection;
9 using System.Reflection.Emit;
10 using System.Diagnostics;
11 using System.Threading;
12 using System.Collections.Generic;
15 public class TestsBase
17 #pragma warning disable 0414
18 #pragma warning disable 0169
19 public int base_field_i;
20 public string base_field_s;
21 static int base_static_i = 57;
22 static string base_static_s = "C";
23 #pragma warning restore 0414
24 #pragma warning restore 0169
32 public sealed class Tests3 {
33 public static void M1 () {
47 public static class Tests4 {
52 public class AAttribute : Attribute {
56 public class BAttribute : AAttribute {
60 [DebuggerDisplay ("Tests", Name="FOO", Target=typeof (int))]
61 [DebuggerTypeProxy (typeof (Tests))]
62 [BAttribute (afield = 1, bfield = 2)]
64 [DebuggerBrowsableAttribute (DebuggerBrowsableState.Collapsed)]
66 public static int static_field_j;
68 [DebuggerBrowsableAttribute (DebuggerBrowsableState.Collapsed)]
69 public int AProperty {
75 public void invoke () {
79 public struct AStruct {
85 [MethodImplAttribute (MethodImplOptions.NoInlining)]
86 public int foo (int val) {
90 [MethodImplAttribute (MethodImplOptions.NoInlining)]
91 public static int static_foo (int val) {
95 [MethodImplAttribute (MethodImplOptions.NoInlining)]
96 public int invoke_return_int () {
100 [MethodImplAttribute (MethodImplOptions.NoInlining)]
101 public static int invoke_static () {
105 [MethodImplAttribute (MethodImplOptions.NoInlining)]
106 public IntPtr invoke_return_intptr () {
111 public class GClass<T> {
113 public static T static_field;
115 [MethodImplAttribute (MethodImplOptions.NoInlining)]
119 [MethodImplAttribute (MethodImplOptions.NoInlining)]
120 public void bp<T2> () {
124 public struct GStruct<T> {
129 [MethodImplAttribute (MethodImplOptions.NoInlining)]
130 public int invoke_return_int () {
147 class TestIfaces : ITest
155 TestIfaces<int> Baz () {
160 class TestIfaces<T> : ITest<T>
162 void ITest<T>.Foo () {
165 void ITest<T>.Bar () {
169 public interface ITest2
174 public class Tests : TestsBase, ITest2
176 #pragma warning disable 0414
180 bool field_bool1, field_bool2;
193 static int static_i = 55;
194 static string static_s = "A";
195 public const int literal_i = 56;
196 public const string literal_s = "B";
198 public AStruct field_struct;
199 public object field_boxed_struct;
200 public GStruct<int> generic_field_struct;
201 public KeyValuePair<int, object> boxed_struct_field;
203 public static int tls_i;
204 public static bool is_attached = Debugger.IsAttached;
206 #pragma warning restore 0414
208 public class NestedClass {
211 public int IntProperty {
220 public int ReadOnlyProperty {
226 public int this [int index] {
232 public static void wait_one ()
234 ManualResetEvent evt = new ManualResetEvent (false);
238 public static int Main (String[] args) {
241 if (args.Length > 0 && args [0] == "suspend-test")
242 /* This contains an infinite loop, so execute it conditionally */
244 if (args.Length >0 && args [0] == "unhandled-exception") {
245 unhandled_exception ();
248 if (args.Length >0 && args [0] == "unhandled-exception-endinvoke") {
249 unhandled_exception_endinvoke ();
252 if (args.Length >0 && args [0] == "unhandled-exception-user") {
253 unhandled_exception_user ();
256 if (args.Length >0 && args [0] == "wait-one") {
279 if (args.Length > 0 && args [0] == "domain-test")
280 /* This takes a lot of time, so execute it conditionally */
282 if (args.Length > 0 && args [0] == "ref-emit-test")
284 if (args.Length > 0 && args [0] == "frames-in-native")
286 if (args.Length > 0 && args [0] == "invoke-single-threaded")
287 new Tests ().invoke_single_threaded ();
291 public static void breakpoints () {
292 /* Call these early so it is JITted by the time a breakpoint is placed on it */
304 bp6<string> (new GClass <int> ());
309 [MethodImplAttribute (MethodImplOptions.NoInlining)]
310 public static void bp1 () {
313 [MethodImplAttribute (MethodImplOptions.NoInlining)]
314 public static void bp2 () {
317 [MethodImplAttribute (MethodImplOptions.NoInlining)]
318 public static void bp3 () {
321 [MethodImplAttribute (MethodImplOptions.NoInlining)]
322 public static void bp4 () {
325 [MethodImplAttribute (MethodImplOptions.NoInlining)]
326 public static void bp5 () {
329 [MethodImplAttribute (MethodImplOptions.NoInlining)]
330 public static void bp6<T> (GClass<int> gc) {
334 [MethodImplAttribute (MethodImplOptions.NoInlining)]
335 public static void bp7<T> () {
338 [MethodImplAttribute (MethodImplOptions.NoInlining)]
339 public static void single_stepping () {
346 ss5 (new int [] { 1, 2, 3 }, new Func<int, bool> (is_even));
353 ss_regress_654694 ();
356 [MethodImplAttribute (MethodImplOptions.NoInlining)]
357 public static void ss1 () {
360 [MethodImplAttribute (MethodImplOptions.NoInlining)]
361 public static void ss2 () {
364 [MethodImplAttribute (MethodImplOptions.NoInlining)]
365 public static int ss3 () {
368 for (int i = 0; i < 10; ++i)
374 [MethodImplAttribute (MethodImplOptions.NoInlining)]
375 public static void ss3_2 () {
379 [MethodImplAttribute (MethodImplOptions.NoInlining)]
380 public static void ss3_2_2 () {
383 [MethodImplAttribute (MethodImplOptions.NoInlining)]
384 public static int ss4 () {
390 [MethodImplAttribute (MethodImplOptions.NoInlining)]
391 public static void ss5 (int[] arr, Func<int, bool> selector) {
392 // Call into linq which calls back into this assembly
393 arr.Count (selector);
396 [MethodImplAttribute (MethodImplOptions.NoInlining)]
397 public static void ss6 (bool b) {
400 throw new Exception ();
404 [MethodImplAttribute (MethodImplOptions.NoInlining)]
405 public static void ss6_2 () {
408 [MethodImplAttribute (MethodImplOptions.NoInlining)]
409 public static void ss7 () {
418 [MethodImplAttribute (MethodImplOptions.NoInlining)]
419 public static void ss7_2 () {
422 [MethodImplAttribute (MethodImplOptions.NoInlining)]
423 public static void ss7_3 () {
424 throw new Exception ();
427 [MethodImplAttribute (MethodImplOptions.NoInlining)]
428 public static void ss_nested () {
429 ss_nested_1 (ss_nested_2 ());
430 ss_nested_1 (ss_nested_2 ());
434 [MethodImplAttribute (MethodImplOptions.NoInlining)]
435 public static void ss_nested_1 (int i) {
438 [MethodImplAttribute (MethodImplOptions.NoInlining)]
439 public static int ss_nested_2 () {
443 [MethodImplAttribute (MethodImplOptions.NoInlining)]
444 public static void ss_nested_3 () {
447 [MethodImplAttribute (MethodImplOptions.NoInlining)]
448 public static bool is_even (int i) {
454 Console.WriteLine ("HIT!");
460 [MethodImplAttribute (MethodImplOptions.NoInlining)]
461 public static void arguments () {
462 arg1 (SByte.MaxValue - 5, Byte.MaxValue - 5, true, Int16.MaxValue - 5, UInt16.MaxValue - 5, 'F', Int32.MaxValue - 5, UInt32.MaxValue - 5, Int64.MaxValue - 5, UInt64.MaxValue - 5, 1.2345f, 6.78910, new IntPtr (Int32.MaxValue - 5), new UIntPtr (UInt32.MaxValue - 5));
464 arg2 ("FOO", null, "BLA", ref i, new GClass <int> { field = 42 }, new object ());
465 Tests t = new Tests () { field_i = 42, field_s = "S" };
469 [MethodImplAttribute (MethodImplOptions.NoInlining)]
470 public static int arg1 (sbyte sb, byte b, bool bl, short s, ushort us, char c, int i, uint ui, long l, ulong ul, float f, double d, IntPtr ip, UIntPtr uip) {
471 return (int)(sb + b + (bl ? 0 : 1) + s + us + (int)c + i + ui + l + (long)ul + f + d + (int)ip + (int)uip);
474 [MethodImplAttribute (MethodImplOptions.NoInlining)]
475 public static string arg2 (string s, string s3, object o, ref int i, GClass <int> gc, object o2) {
476 return s + (s3 != null ? "" : "") + o + i + gc.field + o2;
479 [MethodImplAttribute (MethodImplOptions.NoInlining)]
480 public object arg3 (string s) {
481 return s + s + s + s + this;
484 [MethodImplAttribute (MethodImplOptions.NoInlining)]
485 public static void objects () {
486 Tests t = new Tests () { field_i = 42, field_bool1 = true, field_bool2 = false, field_char = 'A', field_byte = 129, field_sbyte = -33, field_short = Int16.MaxValue - 5, field_ushort = UInt16.MaxValue - 5, field_long = Int64.MaxValue - 5, field_ulong = UInt64.MaxValue - 5, field_float = 3.14f, field_double = 3.14f, field_s = "S", base_field_i = 43, base_field_s = "T", field_enum = AnEnum.B, field_class = null, field_intptr = new IntPtr (Int32.MaxValue - 5), field_nullable = null };
487 t.o1 (new Tests2 () { field_j = 43 }, new GClass <int> { field = 42 }, new GClass <string> { field = "FOO" });
488 o2 (new string [] { "BAR", "BAZ" }, new int[] { 42, 43 }, new int [,] { { 1, 2 }, { 3, 4 }}, (int[,])Array.CreateInstance (typeof (int), new int [] { 2, 2}, new int [] { 1, 3}), new int[] { 0 });
491 [MethodImplAttribute (MethodImplOptions.NoInlining)]
492 public object o1 (Tests2 t, GClass <int> gc1, GClass <string> gc2) {
493 if (t == null || gc1 == null || gc2 == null)
499 [MethodImplAttribute (MethodImplOptions.NoInlining)]
500 public static string o2 (string[] s2, int[] s3, int[,] s4, int[,] s5, IList<int> s6) {
501 return s2 [0] + s3 [0] + s4 [0, 0] + s6 [0];
504 [MethodImplAttribute (MethodImplOptions.NoInlining)]
505 public static void objrefs () {
506 Tests t = new Tests () {};
514 [MethodImplAttribute (MethodImplOptions.NoInlining)]
515 public static void set_child (Tests t) {
516 t.child = new Tests ();
519 [MethodImplAttribute (MethodImplOptions.NoInlining)]
520 public void objrefs1 () {
523 [MethodImplAttribute (MethodImplOptions.NoInlining)]
524 public static void objrefs2 () {
527 public static void vtypes () {
528 Tests t = new Tests () { field_struct = new AStruct () { i = 42, s = "S", k = 43 }, generic_field_struct = new GStruct<int> () { i = 42 }, field_boxed_struct = new AStruct () { i = 42 }, boxed_struct_field = new KeyValuePair<int, object> (1, (long)42 ) };
529 AStruct s = new AStruct { i = 44, s = "T", k = 45 };
530 AStruct[] arr = new AStruct[] {
531 new AStruct () { i = 1, s = "S1" },
532 new AStruct () { i = 2, s = "S2" } };
538 [MethodImplAttribute (MethodImplOptions.NoInlining)]
539 public object vtypes1 (AStruct s, AStruct[] arr) {
546 [MethodImplAttribute (MethodImplOptions.NoInlining)]
547 public static void vtypes2 (AStruct s) {
551 [MethodImplAttribute (MethodImplOptions.NoInlining)]
552 public static void vtypes3 (AStruct s) {
553 AStruct.static_foo (5);
556 [MethodImplAttribute (MethodImplOptions.NoInlining)]
557 public static void locals () {
560 locals2<string> (null, 5, "ABC", ref s);
566 [MethodImplAttribute (MethodImplOptions.NoInlining)]
567 static void locals11 (double a, ref double b) {
570 [MethodImplAttribute (MethodImplOptions.NoInlining)]
571 public static void locals1 (string[] args) {
575 locals11 (b: ref ri, a: ri);
577 for (int j = 0; j < 10; ++j) {
582 [MethodImplAttribute (MethodImplOptions.NoInlining)]
584 [StateMachine (typeof (int))]
586 public static void locals2<T> (string[] args, int arg, T t, ref string rs) {
590 for (int j = 0; j < 10; ++j) {
600 [MethodImplAttribute (MethodImplOptions.NoInlining)]
601 public static void locals3 () {
621 [MethodImplAttribute (MethodImplOptions.NoInlining)]
622 public static void locals4 () {
625 [MethodImplAttribute (MethodImplOptions.NoInlining)]
626 public static void locals5 () {
629 [MethodImplAttribute (MethodImplOptions.NoInlining)]
630 public static void locals6 () {
633 for (i = 0; i < 10; ++i)
636 for (i = 0; i < 10; ++i)
646 [MethodImplAttribute (MethodImplOptions.NoInlining)]
647 public static void locals6_1 () {
650 [MethodImplAttribute (MethodImplOptions.NoInlining)]
651 public static void locals6_2 (int arg) {
654 [MethodImplAttribute (MethodImplOptions.NoInlining)]
655 public static void locals6_3 () {
656 // Clobber all registers
657 int sum = 0, i, j, k, l, m;
658 for (i = 0; i < 100; ++i)
660 for (j = 0; j < 100; ++j)
662 for (k = 0; k < 100; ++k)
664 for (l = 0; l < 100; ++l)
666 for (m = 0; m < 100; ++m)
670 [MethodImplAttribute (MethodImplOptions.NoInlining)]
671 public static void locals6_4 (int arg) {
674 [MethodImplAttribute (MethodImplOptions.NoInlining)]
675 public static void locals6_5 () {
678 [MethodImplAttribute (MethodImplOptions.NoInlining)]
679 public static void locals6_6 (int arg) {
682 [MethodImplAttribute (MethodImplOptions.NoInlining)]
683 public static void locals7<T> (T arg) {
688 [MethodImplAttribute (MethodImplOptions.NoInlining)]
689 public static void line_numbers () {
693 [MethodImplAttribute (MethodImplOptions.NoInlining)]
694 public static void suspend () {
702 [MethodImplAttribute (MethodImplOptions.NoInlining)]
703 public static void type_info () {
704 Tests t = new Tests () { field_i = 42, field_s = "S", base_field_i = 43, base_field_s = "T", field_enum = AnEnum.B };
705 t.ti1 (new Tests2 () { field_j = 43 }, new GClass <int> { field = 42 }, new GClass <string> { field = "FOO" });
708 AStruct s = new AStruct () { i = 42, s = "S", k = 43 };
710 ti2 (new string [] { "BAR", "BAZ" }, new int[] { 42, 43 }, new int [,] { { 1, 2 }, { 3, 4 }}, ref val, (int*)IntPtr.Zero, 5, s, new Tests (), new Tests2 (), new GClass <int> (), AnEnum.B);
714 [MethodImplAttribute (MethodImplOptions.NoInlining)]
715 public object ti1 (Tests2 t, GClass <int> gc1, GClass <string> gc2) {
716 if (t == null || gc1 == null || gc2 == null)
722 [MethodImplAttribute (MethodImplOptions.NoInlining)]
723 public static unsafe string ti2 (string[] s2, int[] s3, int[,] s4, ref int ri, int* ptr, int i, AStruct s, Tests t, Tests2 t2, GClass<int> g, AnEnum ae) {
724 return s2 [0] + s3 [0] + s4 [0, 0];
727 [MethodImplAttribute (MethodImplOptions.NoInlining)]
728 public static void assembly_load () {
732 [MethodImplAttribute (MethodImplOptions.NoInlining)]
733 public static void assembly_load_2 () {
734 // This will load System.dll while holding the loader lock
738 [MethodImplAttribute (MethodImplOptions.NoInlining)]
739 public static void invoke () {
740 new Tests ().invoke1 (new Tests2 (), new AStruct () { i = 42, j = (IntPtr)43 }, new GStruct<int> { j = 42 });
741 new Tests ().invoke_ex ();
744 [MethodImplAttribute (MethodImplOptions.NoInlining)]
745 public void invoke1 (Tests2 t, AStruct s, GStruct<int> g) {
749 [MethodImplAttribute (MethodImplOptions.NoInlining)]
750 public void invoke2 () {
753 [MethodImplAttribute (MethodImplOptions.NoInlining)]
754 public void invoke_ex () {
758 [MethodImplAttribute (MethodImplOptions.NoInlining)]
759 public void invoke_ex_inner () {
761 throw new Exception ();
768 [MethodImplAttribute (MethodImplOptions.NoInlining)]
769 public void invoke_single_threaded () {
770 // Spawn a thread incrementing a counter
771 bool finished = false;
773 new Thread (delegate () {
780 invoke_single_threaded_2 ();
785 [MethodImplAttribute (MethodImplOptions.NoInlining)]
786 public void invoke_single_threaded_2 () {
789 public void invoke_return_void () {
792 public string invoke_return_ref () {
796 public object invoke_return_null () {
800 public int invoke_return_primitive () {
804 public int? invoke_return_nullable () {
808 public int? invoke_return_nullable_null () {
812 public void invoke_type_load () {
819 public long invoke_pass_primitive (byte ub, sbyte sb, short ss, ushort us, int i, uint ui, long l, ulong ul, char c, bool b, float f, double d) {
820 return ub + sb + ss + us + i + ui + l + (long)ul + (int)c + (b ? 1 : 0) + (int)f + (int)d;
823 public int invoke_pass_primitive2 (bool b) {
827 public string invoke_pass_ref (string s) {
831 public static string invoke_static_pass_ref (string s) {
835 public static void invoke_static_return_void () {
838 public static void invoke_throws () {
839 throw new Exception ();
842 public int invoke_iface () {
846 [MethodImplAttribute (MethodImplOptions.NoInlining)]
847 public static void exceptions () {
849 throw new OverflowException ();
850 } catch (Exception) {
853 throw new OverflowException ();
854 } catch (Exception) {
857 throw new ArgumentException ();
858 } catch (Exception) {
861 throw new OverflowException ();
862 } catch (Exception) {
868 } catch (Exception) {
873 } catch (Exception) {
877 [MethodImplAttribute (MethodImplOptions.NoInlining)]
878 public static void unhandled_exception () {
879 ThreadPool.QueueUserWorkItem (delegate {
880 throw new InvalidOperationException ();
882 Thread.Sleep (10000);
885 [MethodImplAttribute (MethodImplOptions.NoInlining)]
886 public static void unhandled_exception_endinvoke_2 () {
889 [MethodImplAttribute (MethodImplOptions.NoInlining)]
890 public static void unhandled_exception_endinvoke () {
891 Action action = new Action (() =>
893 throw new Exception ("thrown");
895 action.BeginInvoke ((ar) => {
897 action.EndInvoke (ar);
898 } catch (Exception ex) {
899 //Console.WriteLine (ex);
903 unhandled_exception_endinvoke_2 ();
906 [MethodImplAttribute (MethodImplOptions.NoInlining)]
907 public static void unhandled_exception_user () {
909 System.Threading.Tasks.Task.Factory.StartNew (() => {
912 Thread.Sleep (10000);
916 [MethodImplAttribute (MethodImplOptions.NoInlining)]
917 public static void Throw () {
918 throw new Exception ();
921 internal static Delegate create_filter_delegate (Delegate dlg, MethodInfo filter_method)
924 throw new ArgumentNullException ();
925 if (dlg.Target != null)
926 throw new ArgumentException ();
927 if (dlg.Method == null)
928 throw new ArgumentException ();
930 var ret_type = dlg.Method.ReturnType;
931 var param_types = dlg.Method.GetParameters ().Select (x => x.ParameterType).ToArray ();
933 var dynamic = new DynamicMethod (Guid.NewGuid ().ToString (), ret_type, param_types, typeof (object), true);
934 var ig = dynamic.GetILGenerator ();
936 LocalBuilder retval = null;
937 if (ret_type != typeof (void))
938 retval = ig.DeclareLocal (ret_type);
940 var label = ig.BeginExceptionBlock ();
942 for (int i = 0; i < param_types.Length; i++)
943 ig.Emit (OpCodes.Ldarg, i);
944 ig.Emit (OpCodes.Call, dlg.Method);
947 ig.Emit (OpCodes.Stloc, retval);
949 ig.Emit (OpCodes.Leave, label);
951 ig.BeginExceptFilterBlock ();
953 ig.Emit (OpCodes.Call, filter_method);
955 ig.BeginCatchBlock (null);
957 ig.Emit (OpCodes.Pop);
959 ig.EndExceptionBlock ();
962 ig.Emit (OpCodes.Ldloc, retval);
964 ig.Emit (OpCodes.Ret);
966 return dynamic.CreateDelegate (dlg.GetType ());
969 [MethodImplAttribute (MethodImplOptions.NoInlining)]
970 static void exception_filter_method () {
971 throw new InvalidOperationException ();
974 [MethodImplAttribute (MethodImplOptions.NoInlining)]
975 static int exception_filter_filter (Exception exc) {
979 [MethodImplAttribute (MethodImplOptions.NoInlining)]
980 public static void exception_filter () {
981 var method = typeof (Tests).GetMethod (
982 "exception_filter_method", BindingFlags.NonPublic | BindingFlags.Static);
983 var filter_method = typeof (Tests).GetMethod (
984 "exception_filter_filter", BindingFlags.NonPublic | BindingFlags.Static);
986 var dlg = Delegate.CreateDelegate (typeof (Action), method);
988 var wrapper = (Action) create_filter_delegate (dlg, filter_method);
993 [MethodImplAttribute (MethodImplOptions.NoInlining)]
994 public static bool return_true () {
998 [MethodImplAttribute (MethodImplOptions.NoInlining)]
999 public static void exceptions2 () {
1001 throw new Exception ();
1002 Console.WriteLine ();
1005 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1006 public static void threads () {
1007 Thread t = new Thread (delegate () {});
1013 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1014 public static void domains () {
1015 AppDomain domain = AppDomain.CreateDomain ("domain");
1017 CrossDomain o = (CrossDomain)domain.CreateInstanceAndUnwrap (
1018 typeof (CrossDomain).Assembly.FullName, "CrossDomain");
1020 domains_2 (o, new CrossDomain ());
1028 AppDomain.Unload (domain);
1033 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1034 public static void domains_2 (object o, object o2) {
1037 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1038 public static void domains_3 () {
1041 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1042 public static void invoke_in_domain () {
1045 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1046 public static void invoke_in_domain_2 () {
1049 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1050 public static void dynamic_methods () {
1051 var m = new DynamicMethod ("dyn_method", typeof (void), new Type [] { typeof (int) }, typeof (object).Module);
1052 var ig = m.GetILGenerator ();
1054 ig.Emit (OpCodes.Ldstr, "FOO");
1055 ig.Emit (OpCodes.Call, typeof (Tests).GetMethod ("dyn_call"));
1056 ig.Emit (OpCodes.Ret);
1058 var del = (Action<int>)m.CreateDelegate (typeof (Action<int>));
1063 public static void dyn_call (string s) {
1066 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1067 public static void ref_emit () {
1068 AssemblyName assemblyName = new AssemblyName ();
1069 assemblyName.Name = "foo";
1071 AssemblyBuilder assembly =
1072 Thread.GetDomain ().DefineDynamicAssembly (
1073 assemblyName, AssemblyBuilderAccess.RunAndSave);
1075 ModuleBuilder module = assembly.DefineDynamicModule ("foo.dll");
1077 TypeBuilder tb = module.DefineType ("foo", TypeAttributes.Public, typeof (object));
1078 MethodBuilder mb = tb.DefineMethod ("ref_emit_method", MethodAttributes.Public|MethodAttributes.Static, CallingConventions.Standard, typeof (void), new Type [] { });
1079 ILGenerator ig = mb.GetILGenerator ();
1080 ig.Emit (OpCodes.Ldstr, "FOO");
1081 ig.Emit (OpCodes.Call, typeof (Tests).GetMethod ("ref_emit_call"));
1082 ig.Emit (OpCodes.Ret);
1084 Type t = tb.CreateType ();
1086 t.GetMethod ("ref_emit_method").Invoke (null, null);
1089 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1090 public static void ref_emit_call (string s) {
1093 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1094 public static void frames_in_native () {
1096 var evt = new ManualResetEvent (false);
1098 object mon = new object ();
1099 ThreadPool.QueueUserWorkItem (delegate {
1100 frames_in_native_2 ();
1106 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1107 static void frames_in_native_2 () {
1108 frames_in_native_3 ();
1111 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1112 static void frames_in_native_3 () {
1115 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1116 public static void string_call (string s) {
1119 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1120 public static void ss_regress_654694 () {
1127 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1128 public static void user () {
1131 Debugger.Log (5, Debugger.IsLogging () ? "A" : "", "B");
1134 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1135 public static void type_load () {
1139 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1140 static void type_load_2 () {
1141 var c1 = new Dictionary<int, int> ();
1143 var c = new TypeLoadClass ();
1145 var c2 = new TypeLoadClass2 ();
1149 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1150 public static void regress () {
1151 regress_2755 (DateTime.Now);
1154 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1155 public static unsafe void regress_2755 (DateTime d) {
1156 int* buffer = stackalloc int [128];
1161 for (int i = 0; i < 128; ++i)
1164 regress_2755_3 (sum);
1167 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1168 public static void regress_2755_2 () {
1171 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1172 public static void regress_2755_3 (int sum) {
1175 static object gc_suspend_field;
1177 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1178 static unsafe void set_gc_suspend_field () {
1179 set_gc_suspend_field_2 ();
1181 int* buffer = stackalloc int [4096];
1184 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1185 static void set_gc_suspend_field_2 () {
1186 gc_suspend_field = new object ();
1189 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1190 static void gc_suspend_1 () {
1193 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1194 public static void gc_suspend_invoke () {
1195 gc_suspend_field = null;
1197 GC.WaitForPendingFinalizers ();
1200 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1201 public static void gc_suspend () {
1202 set_gc_suspend_field ();
1206 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1207 public static void generic_method<T> () where T : class {
1211 class TypeLoadClass {
1214 class TypeLoadClass2 {
1217 public class CrossDomain : MarshalByRefObject
1219 public void invoke () {
1220 Tests.invoke_in_domain ();
1223 public void invoke_2 () {
1224 Tests.invoke_in_domain_2 ();
1227 public int invoke_3 () {
1234 public ProcessStartInfo info;
1237 // Class used for line number info testing, don't change its layout
1238 public class LineNumbers
1240 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1241 public static void ln1 () {
1247 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1248 public static void ln2 () {
1251 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1252 public static void ln3 () {
1253 #pragma warning disable 0219
1255 #pragma warning restore 0219