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 class Tests : TestsBase
171 #pragma warning disable 0414
175 bool field_bool1, field_bool2;
188 static int static_i = 55;
189 static string static_s = "A";
190 public const int literal_i = 56;
191 public const string literal_s = "B";
193 public AStruct field_struct;
194 public object field_boxed_struct;
195 public GStruct<int> generic_field_struct;
197 public static int tls_i;
198 public static bool is_attached = Debugger.IsAttached;
200 #pragma warning restore 0414
202 public class NestedClass {
205 public int IntProperty {
214 public int ReadOnlyProperty {
220 public int this [int index] {
226 public static int Main (String[] args) {
229 if (args.Length > 0 && args [0] == "suspend-test")
230 /* This contains an infinite loop, so execute it conditionally */
232 if (args.Length >0 && args [0] == "unhandled-exception") {
233 unhandled_exception ();
236 if (args.Length >0 && args [0] == "unhandled-exception-endinvoke") {
237 unhandled_exception_endinvoke ();
240 if (args.Length >0 && args [0] == "unhandled-exception-user") {
241 unhandled_exception_user ();
263 if (args.Length > 0 && args [0] == "domain-test")
264 /* This takes a lot of time, so execute it conditionally */
266 if (args.Length > 0 && args [0] == "ref-emit-test")
268 if (args.Length > 0 && args [0] == "frames-in-native")
270 if (args.Length > 0 && args [0] == "invoke-single-threaded")
271 new Tests ().invoke_single_threaded ();
275 public static void breakpoints () {
276 /* Call these early so it is JITted by the time a breakpoint is placed on it */
288 bp6<string> (new GClass <int> ());
293 [MethodImplAttribute (MethodImplOptions.NoInlining)]
294 public static void bp1 () {
297 [MethodImplAttribute (MethodImplOptions.NoInlining)]
298 public static void bp2 () {
301 [MethodImplAttribute (MethodImplOptions.NoInlining)]
302 public static void bp3 () {
305 [MethodImplAttribute (MethodImplOptions.NoInlining)]
306 public static void bp4 () {
309 [MethodImplAttribute (MethodImplOptions.NoInlining)]
310 public static void bp5 () {
313 [MethodImplAttribute (MethodImplOptions.NoInlining)]
314 public static void bp6<T> (GClass<int> gc) {
318 [MethodImplAttribute (MethodImplOptions.NoInlining)]
319 public static void bp7<T> () {
322 [MethodImplAttribute (MethodImplOptions.NoInlining)]
323 public static void single_stepping () {
330 ss5 (new int [] { 1, 2, 3 }, new Func<int, bool> (is_even));
336 ss_regress_654694 ();
339 [MethodImplAttribute (MethodImplOptions.NoInlining)]
340 public static void ss1 () {
343 [MethodImplAttribute (MethodImplOptions.NoInlining)]
344 public static void ss2 () {
347 [MethodImplAttribute (MethodImplOptions.NoInlining)]
348 public static int ss3 () {
351 for (int i = 0; i < 10; ++i)
357 [MethodImplAttribute (MethodImplOptions.NoInlining)]
358 public static void ss3_2 () {
362 [MethodImplAttribute (MethodImplOptions.NoInlining)]
363 public static void ss3_2_2 () {
366 [MethodImplAttribute (MethodImplOptions.NoInlining)]
367 public static int ss4 () {
373 [MethodImplAttribute (MethodImplOptions.NoInlining)]
374 public static void ss5 (int[] arr, Func<int, bool> selector) {
375 // Call into linq which calls back into this assembly
376 arr.Count (selector);
379 [MethodImplAttribute (MethodImplOptions.NoInlining)]
380 public static void ss6 (bool b) {
383 throw new Exception ();
387 [MethodImplAttribute (MethodImplOptions.NoInlining)]
388 public static void ss6_2 () {
391 [MethodImplAttribute (MethodImplOptions.NoInlining)]
392 public static void ss7 () {
401 [MethodImplAttribute (MethodImplOptions.NoInlining)]
402 public static void ss7_2 () {
405 [MethodImplAttribute (MethodImplOptions.NoInlining)]
406 public static void ss7_3 () {
407 throw new Exception ();
410 [MethodImplAttribute (MethodImplOptions.NoInlining)]
411 public static bool is_even (int i) {
417 Console.WriteLine ("HIT!");
423 [MethodImplAttribute (MethodImplOptions.NoInlining)]
424 public static void arguments () {
425 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));
427 arg2 ("FOO", null, "BLA", ref i, new GClass <int> { field = 42 }, new object ());
428 Tests t = new Tests () { field_i = 42, field_s = "S" };
432 [MethodImplAttribute (MethodImplOptions.NoInlining)]
433 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) {
434 return (int)(sb + b + (bl ? 0 : 1) + s + us + (int)c + i + ui + l + (long)ul + f + d + (int)ip + (int)uip);
437 [MethodImplAttribute (MethodImplOptions.NoInlining)]
438 public static string arg2 (string s, string s3, object o, ref int i, GClass <int> gc, object o2) {
439 return s + (s3 != null ? "" : "") + o + i + gc.field + o2;
442 [MethodImplAttribute (MethodImplOptions.NoInlining)]
443 public object arg3 (string s) {
444 return s + s + s + s + this;
447 [MethodImplAttribute (MethodImplOptions.NoInlining)]
448 public static void objects () {
449 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 };
450 t.o1 (new Tests2 () { field_j = 43 }, new GClass <int> { field = 42 }, new GClass <string> { field = "FOO" });
451 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 });
454 [MethodImplAttribute (MethodImplOptions.NoInlining)]
455 public object o1 (Tests2 t, GClass <int> gc1, GClass <string> gc2) {
456 if (t == null || gc1 == null || gc2 == null)
462 [MethodImplAttribute (MethodImplOptions.NoInlining)]
463 public static string o2 (string[] s2, int[] s3, int[,] s4, int[,] s5, IList<int> s6) {
464 return s2 [0] + s3 [0] + s4 [0, 0] + s6 [0];
467 [MethodImplAttribute (MethodImplOptions.NoInlining)]
468 public static void objrefs () {
469 Tests t = new Tests () {};
477 [MethodImplAttribute (MethodImplOptions.NoInlining)]
478 public static void set_child (Tests t) {
479 t.child = new Tests ();
482 [MethodImplAttribute (MethodImplOptions.NoInlining)]
483 public void objrefs1 () {
486 [MethodImplAttribute (MethodImplOptions.NoInlining)]
487 public static void objrefs2 () {
490 public static void vtypes () {
491 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 }};
492 AStruct s = new AStruct { i = 44, s = "T", k = 45 };
493 AStruct[] arr = new AStruct[] {
494 new AStruct () { i = 1, s = "S1" },
495 new AStruct () { i = 2, s = "S2" } };
501 [MethodImplAttribute (MethodImplOptions.NoInlining)]
502 public object vtypes1 (AStruct s, AStruct[] arr) {
509 [MethodImplAttribute (MethodImplOptions.NoInlining)]
510 public static void vtypes2 (AStruct s) {
514 [MethodImplAttribute (MethodImplOptions.NoInlining)]
515 public static void vtypes3 (AStruct s) {
516 AStruct.static_foo (5);
519 [MethodImplAttribute (MethodImplOptions.NoInlining)]
520 public static void locals () {
523 locals2<string> (null, 5, "ABC", ref s);
529 [MethodImplAttribute (MethodImplOptions.NoInlining)]
530 static void locals11 (double a, ref double b) {
533 [MethodImplAttribute (MethodImplOptions.NoInlining)]
534 public static void locals1 (string[] args) {
538 locals11 (b: ref ri, a: ri);
540 for (int j = 0; j < 10; ++j) {
545 [MethodImplAttribute (MethodImplOptions.NoInlining)]
546 [StateMachine (typeof (int))]
547 public static void locals2<T> (string[] args, int arg, T t, ref string rs) {
551 for (int j = 0; j < 10; ++j) {
560 [MethodImplAttribute (MethodImplOptions.NoInlining)]
561 public static void locals3 () {
581 [MethodImplAttribute (MethodImplOptions.NoInlining)]
582 public static void locals4 () {
585 [MethodImplAttribute (MethodImplOptions.NoInlining)]
586 public static void locals5 () {
589 [MethodImplAttribute (MethodImplOptions.NoInlining)]
590 public static void locals6 () {
593 for (i = 0; i < 10; ++i)
596 for (i = 0; i < 10; ++i)
606 [MethodImplAttribute (MethodImplOptions.NoInlining)]
607 public static void locals6_1 () {
610 [MethodImplAttribute (MethodImplOptions.NoInlining)]
611 public static void locals6_2 (int arg) {
614 [MethodImplAttribute (MethodImplOptions.NoInlining)]
615 public static void locals6_3 () {
616 // Clobber all registers
617 int sum = 0, i, j, k, l, m;
618 for (i = 0; i < 100; ++i)
620 for (j = 0; j < 100; ++j)
622 for (k = 0; k < 100; ++k)
624 for (l = 0; l < 100; ++l)
626 for (m = 0; m < 100; ++m)
630 [MethodImplAttribute (MethodImplOptions.NoInlining)]
631 public static void locals6_4 (int arg) {
634 [MethodImplAttribute (MethodImplOptions.NoInlining)]
635 public static void locals6_5 () {
638 [MethodImplAttribute (MethodImplOptions.NoInlining)]
639 public static void locals6_6 (int arg) {
642 [MethodImplAttribute (MethodImplOptions.NoInlining)]
643 public static void locals7<T> (T arg) {
648 [MethodImplAttribute (MethodImplOptions.NoInlining)]
649 public static void line_numbers () {
653 [MethodImplAttribute (MethodImplOptions.NoInlining)]
654 public static void suspend () {
662 [MethodImplAttribute (MethodImplOptions.NoInlining)]
663 public static void type_info () {
664 Tests t = new Tests () { field_i = 42, field_s = "S", base_field_i = 43, base_field_s = "T", field_enum = AnEnum.B };
665 t.ti1 (new Tests2 () { field_j = 43 }, new GClass <int> { field = 42 }, new GClass <string> { field = "FOO" });
668 AStruct s = new AStruct () { i = 42, s = "S", k = 43 };
670 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);
674 [MethodImplAttribute (MethodImplOptions.NoInlining)]
675 public object ti1 (Tests2 t, GClass <int> gc1, GClass <string> gc2) {
676 if (t == null || gc1 == null || gc2 == null)
682 [MethodImplAttribute (MethodImplOptions.NoInlining)]
683 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) {
684 return s2 [0] + s3 [0] + s4 [0, 0];
687 [MethodImplAttribute (MethodImplOptions.NoInlining)]
688 public static void assembly_load () {
692 [MethodImplAttribute (MethodImplOptions.NoInlining)]
693 public static void assembly_load_2 () {
694 // This will load System.dll while holding the loader lock
698 [MethodImplAttribute (MethodImplOptions.NoInlining)]
699 public static void invoke () {
700 new Tests ().invoke1 (new Tests2 (), new AStruct () { i = 42, j = (IntPtr)43 }, new GStruct<int> { j = 42 });
701 new Tests ().invoke_ex ();
704 [MethodImplAttribute (MethodImplOptions.NoInlining)]
705 public void invoke1 (Tests2 t, AStruct s, GStruct<int> g) {
709 [MethodImplAttribute (MethodImplOptions.NoInlining)]
710 public void invoke2 () {
713 [MethodImplAttribute (MethodImplOptions.NoInlining)]
714 public void invoke_ex () {
718 [MethodImplAttribute (MethodImplOptions.NoInlining)]
719 public void invoke_ex_inner () {
721 throw new Exception ();
728 [MethodImplAttribute (MethodImplOptions.NoInlining)]
729 public void invoke_single_threaded () {
730 // Spawn a thread incrementing a counter
731 bool finished = false;
733 new Thread (delegate () {
740 invoke_single_threaded_2 ();
745 [MethodImplAttribute (MethodImplOptions.NoInlining)]
746 public void invoke_single_threaded_2 () {
749 public void invoke_return_void () {
752 public string invoke_return_ref () {
756 public object invoke_return_null () {
760 public int invoke_return_primitive () {
764 public int? invoke_return_nullable () {
768 public int? invoke_return_nullable_null () {
772 public void invoke_type_load () {
779 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) {
780 return ub + sb + ss + us + i + ui + l + (long)ul + (int)c + (b ? 1 : 0) + (int)f + (int)d;
783 public int invoke_pass_primitive2 (bool b) {
787 public string invoke_pass_ref (string s) {
791 public static string invoke_static_pass_ref (string s) {
795 public static void invoke_static_return_void () {
798 public static void invoke_throws () {
799 throw new Exception ();
802 [MethodImplAttribute (MethodImplOptions.NoInlining)]
803 public static void exceptions () {
805 throw new OverflowException ();
806 } catch (Exception) {
809 throw new OverflowException ();
810 } catch (Exception) {
813 throw new ArgumentException ();
814 } catch (Exception) {
817 throw new OverflowException ();
818 } catch (Exception) {
824 } catch (Exception) {
829 } catch (Exception) {
833 [MethodImplAttribute (MethodImplOptions.NoInlining)]
834 public static void unhandled_exception () {
835 ThreadPool.QueueUserWorkItem (delegate {
836 throw new InvalidOperationException ();
838 Thread.Sleep (10000);
841 [MethodImplAttribute (MethodImplOptions.NoInlining)]
842 public static void unhandled_exception_endinvoke_2 () {
845 [MethodImplAttribute (MethodImplOptions.NoInlining)]
846 public static void unhandled_exception_endinvoke () {
847 Action action = new Action (() =>
849 throw new Exception ("thrown");
851 action.BeginInvoke ((ar) => {
853 action.EndInvoke (ar);
854 } catch (Exception ex) {
855 //Console.WriteLine (ex);
859 unhandled_exception_endinvoke_2 ();
862 [MethodImplAttribute (MethodImplOptions.NoInlining)]
863 public static void unhandled_exception_user () {
865 System.Threading.Tasks.Task.Factory.StartNew (() => {
868 Thread.Sleep (10000);
872 [MethodImplAttribute (MethodImplOptions.NoInlining)]
873 public static void Throw () {
874 throw new Exception ();
877 internal static Delegate create_filter_delegate (Delegate dlg, MethodInfo filter_method)
880 throw new ArgumentNullException ();
881 if (dlg.Target != null)
882 throw new ArgumentException ();
883 if (dlg.Method == null)
884 throw new ArgumentException ();
886 var ret_type = dlg.Method.ReturnType;
887 var param_types = dlg.Method.GetParameters ().Select (x => x.ParameterType).ToArray ();
889 var dynamic = new DynamicMethod (Guid.NewGuid ().ToString (), ret_type, param_types, typeof (object), true);
890 var ig = dynamic.GetILGenerator ();
892 LocalBuilder retval = null;
893 if (ret_type != typeof (void))
894 retval = ig.DeclareLocal (ret_type);
896 var label = ig.BeginExceptionBlock ();
898 for (int i = 0; i < param_types.Length; i++)
899 ig.Emit (OpCodes.Ldarg, i);
900 ig.Emit (OpCodes.Call, dlg.Method);
903 ig.Emit (OpCodes.Stloc, retval);
905 ig.Emit (OpCodes.Leave, label);
907 ig.BeginExceptFilterBlock ();
909 ig.Emit (OpCodes.Call, filter_method);
911 ig.BeginCatchBlock (null);
913 ig.Emit (OpCodes.Pop);
915 ig.EndExceptionBlock ();
918 ig.Emit (OpCodes.Ldloc, retval);
920 ig.Emit (OpCodes.Ret);
922 return dynamic.CreateDelegate (dlg.GetType ());
925 [MethodImplAttribute (MethodImplOptions.NoInlining)]
926 static void exception_filter_method () {
927 throw new InvalidOperationException ();
930 [MethodImplAttribute (MethodImplOptions.NoInlining)]
931 static int exception_filter_filter (Exception exc) {
935 [MethodImplAttribute (MethodImplOptions.NoInlining)]
936 public static void exception_filter () {
937 var method = typeof (Tests).GetMethod (
938 "exception_filter_method", BindingFlags.NonPublic | BindingFlags.Static);
939 var filter_method = typeof (Tests).GetMethod (
940 "exception_filter_filter", BindingFlags.NonPublic | BindingFlags.Static);
942 var dlg = Delegate.CreateDelegate (typeof (Action), method);
944 var wrapper = (Action) create_filter_delegate (dlg, filter_method);
949 [MethodImplAttribute (MethodImplOptions.NoInlining)]
950 public static bool return_true () {
954 [MethodImplAttribute (MethodImplOptions.NoInlining)]
955 public static void exceptions2 () {
957 throw new Exception ();
958 Console.WriteLine ();
961 [MethodImplAttribute (MethodImplOptions.NoInlining)]
962 public static void threads () {
963 Thread t = new Thread (delegate () {});
969 [MethodImplAttribute (MethodImplOptions.NoInlining)]
970 public static void domains () {
971 AppDomain domain = AppDomain.CreateDomain ("domain");
973 CrossDomain o = (CrossDomain)domain.CreateInstanceAndUnwrap (
974 typeof (CrossDomain).Assembly.FullName, "CrossDomain");
976 domains_2 (o, new CrossDomain ());
984 AppDomain.Unload (domain);
989 [MethodImplAttribute (MethodImplOptions.NoInlining)]
990 public static void domains_2 (object o, object o2) {
993 [MethodImplAttribute (MethodImplOptions.NoInlining)]
994 public static void domains_3 () {
997 [MethodImplAttribute (MethodImplOptions.NoInlining)]
998 public static void invoke_in_domain () {
1001 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1002 public static void invoke_in_domain_2 () {
1005 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1006 public static void dynamic_methods () {
1007 var m = new DynamicMethod ("dyn_method", typeof (void), new Type [] { typeof (int) }, typeof (object).Module);
1008 var ig = m.GetILGenerator ();
1010 ig.Emit (OpCodes.Ldstr, "FOO");
1011 ig.Emit (OpCodes.Call, typeof (Tests).GetMethod ("dyn_call"));
1012 ig.Emit (OpCodes.Ret);
1014 var del = (Action<int>)m.CreateDelegate (typeof (Action<int>));
1019 public static void dyn_call (string s) {
1022 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1023 public static void ref_emit () {
1024 AssemblyName assemblyName = new AssemblyName ();
1025 assemblyName.Name = "foo";
1027 AssemblyBuilder assembly =
1028 Thread.GetDomain ().DefineDynamicAssembly (
1029 assemblyName, AssemblyBuilderAccess.RunAndSave);
1031 ModuleBuilder module = assembly.DefineDynamicModule ("foo.dll");
1033 TypeBuilder tb = module.DefineType ("foo", TypeAttributes.Public, typeof (object));
1034 MethodBuilder mb = tb.DefineMethod ("ref_emit_method", MethodAttributes.Public|MethodAttributes.Static, CallingConventions.Standard, typeof (void), new Type [] { });
1035 ILGenerator ig = mb.GetILGenerator ();
1036 ig.Emit (OpCodes.Ldstr, "FOO");
1037 ig.Emit (OpCodes.Call, typeof (Tests).GetMethod ("ref_emit_call"));
1038 ig.Emit (OpCodes.Ret);
1040 Type t = tb.CreateType ();
1042 t.GetMethod ("ref_emit_method").Invoke (null, null);
1045 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1046 public static void ref_emit_call (string s) {
1049 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1050 public static void frames_in_native () {
1052 var evt = new ManualResetEvent (false);
1054 object mon = new object ();
1055 ThreadPool.QueueUserWorkItem (delegate {
1056 frames_in_native_2 ();
1062 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1063 static void frames_in_native_2 () {
1064 frames_in_native_3 ();
1067 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1068 static void frames_in_native_3 () {
1071 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1072 public static void string_call (string s) {
1075 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1076 public static void ss_regress_654694 () {
1083 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1084 public static void user () {
1087 Debugger.Log (5, Debugger.IsLogging () ? "A" : "", "B");
1090 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1091 public static void type_load () {
1095 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1096 static void type_load_2 () {
1097 var c1 = new Dictionary<int, int> ();
1099 var c = new TypeLoadClass ();
1101 var c2 = new TypeLoadClass2 ();
1105 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1106 public static void regress () {
1107 regress_2755 (DateTime.Now);
1110 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1111 public static unsafe void regress_2755 (DateTime d) {
1112 int* buffer = stackalloc int [128];
1117 for (int i = 0; i < 128; ++i)
1120 regress_2755_3 (sum);
1123 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1124 public static void regress_2755_2 () {
1127 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1128 public static void regress_2755_3 (int sum) {
1131 static object gc_suspend_field;
1133 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1134 static unsafe void set_gc_suspend_field () {
1135 set_gc_suspend_field_2 ();
1137 int* buffer = stackalloc int [4096];
1140 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1141 static void set_gc_suspend_field_2 () {
1142 gc_suspend_field = new object ();
1145 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1146 static void gc_suspend_1 () {
1149 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1150 public static void gc_suspend_invoke () {
1151 gc_suspend_field = null;
1153 GC.WaitForPendingFinalizers ();
1156 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1157 public static void gc_suspend () {
1158 set_gc_suspend_field ();
1162 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1163 public static void generic_method<T> () where T : class {
1167 class TypeLoadClass {
1170 class TypeLoadClass2 {
1173 public class CrossDomain : MarshalByRefObject
1175 public void invoke () {
1176 Tests.invoke_in_domain ();
1179 public void invoke_2 () {
1180 Tests.invoke_in_domain_2 ();
1183 public int invoke_3 () {
1190 public ProcessStartInfo info;
1193 // Class used for line number info testing, don't change its layout
1194 public class LineNumbers
1196 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1197 public static void ln1 () {
1203 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1204 public static void ln2 () {
1207 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1208 public static void ln3 () {
1209 #pragma warning disable 0219
1211 #pragma warning restore 0219