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 [DebuggerDisplay ("Tests", Name="FOO", Target=typeof (int))]
53 [DebuggerTypeProxy (typeof (Tests))]
55 [DebuggerBrowsableAttribute (DebuggerBrowsableState.Collapsed)]
57 public static int static_field_j;
59 [DebuggerBrowsableAttribute (DebuggerBrowsableState.Collapsed)]
60 public int AProperty {
66 public void invoke () {
70 public struct AStruct {
76 [MethodImplAttribute (MethodImplOptions.NoInlining)]
77 public int foo (int val) {
81 [MethodImplAttribute (MethodImplOptions.NoInlining)]
82 public static int static_foo (int val) {
86 [MethodImplAttribute (MethodImplOptions.NoInlining)]
87 public int invoke_return_int () {
91 [MethodImplAttribute (MethodImplOptions.NoInlining)]
92 public static int invoke_static () {
96 [MethodImplAttribute (MethodImplOptions.NoInlining)]
97 public IntPtr invoke_return_intptr () {
102 public class GClass<T> {
104 public static T static_field;
106 [MethodImplAttribute (MethodImplOptions.NoInlining)]
110 [MethodImplAttribute (MethodImplOptions.NoInlining)]
111 public void bp<T2> () {
115 public struct GStruct<T> {
120 [MethodImplAttribute (MethodImplOptions.NoInlining)]
121 public int invoke_return_int () {
138 class TestIfaces : ITest
146 TestIfaces<int> Baz () {
151 class TestIfaces<T> : ITest<T>
153 void ITest<T>.Foo () {
156 void ITest<T>.Bar () {
160 public class Tests : TestsBase
162 #pragma warning disable 0414
166 bool field_bool1, field_bool2;
179 static int static_i = 55;
180 static string static_s = "A";
181 public const int literal_i = 56;
182 public const string literal_s = "B";
184 public AStruct field_struct;
185 public object field_boxed_struct;
186 public GStruct<int> generic_field_struct;
188 public static int tls_i;
189 public static bool is_attached = Debugger.IsAttached;
191 #pragma warning restore 0414
193 public class NestedClass {
196 public int IntProperty {
205 public int ReadOnlyProperty {
211 public int this [int index] {
217 public static int Main (String[] args) {
220 if (args.Length > 0 && args [0] == "suspend-test")
221 /* This contains an infinite loop, so execute it conditionally */
223 if (args.Length >0 && args [0] == "unhandled-exception") {
224 unhandled_exception ();
227 if (args.Length >0 && args [0] == "unhandled-exception-user") {
228 unhandled_exception_user ();
250 if (args.Length > 0 && args [0] == "domain-test")
251 /* This takes a lot of time, so execute it conditionally */
253 if (args.Length > 0 && args [0] == "ref-emit-test")
255 if (args.Length > 0 && args [0] == "frames-in-native")
257 if (args.Length > 0 && args [0] == "invoke-single-threaded")
258 new Tests ().invoke_single_threaded ();
262 public static void breakpoints () {
263 /* Call these early so it is JITted by the time a breakpoint is placed on it */
275 bp6<string> (new GClass <int> ());
280 [MethodImplAttribute (MethodImplOptions.NoInlining)]
281 public static void bp1 () {
284 [MethodImplAttribute (MethodImplOptions.NoInlining)]
285 public static void bp2 () {
288 [MethodImplAttribute (MethodImplOptions.NoInlining)]
289 public static void bp3 () {
292 [MethodImplAttribute (MethodImplOptions.NoInlining)]
293 public static void bp4 () {
296 [MethodImplAttribute (MethodImplOptions.NoInlining)]
297 public static void bp5 () {
300 [MethodImplAttribute (MethodImplOptions.NoInlining)]
301 public static void bp6<T> (GClass<int> gc) {
305 [MethodImplAttribute (MethodImplOptions.NoInlining)]
306 public static void bp7<T> () {
309 [MethodImplAttribute (MethodImplOptions.NoInlining)]
310 public static void single_stepping () {
317 ss5 (new int [] { 1, 2, 3 }, new Func<int, bool> (is_even));
323 ss_regress_654694 ();
326 [MethodImplAttribute (MethodImplOptions.NoInlining)]
327 public static void ss1 () {
330 [MethodImplAttribute (MethodImplOptions.NoInlining)]
331 public static void ss2 () {
334 [MethodImplAttribute (MethodImplOptions.NoInlining)]
335 public static int ss3 () {
338 for (int i = 0; i < 10; ++i)
344 [MethodImplAttribute (MethodImplOptions.NoInlining)]
345 public static void ss3_2 () {
349 [MethodImplAttribute (MethodImplOptions.NoInlining)]
350 public static void ss3_2_2 () {
353 [MethodImplAttribute (MethodImplOptions.NoInlining)]
354 public static int ss4 () {
360 [MethodImplAttribute (MethodImplOptions.NoInlining)]
361 public static void ss5 (int[] arr, Func<int, bool> selector) {
362 // Call into linq which calls back into this assembly
363 arr.Count (selector);
366 [MethodImplAttribute (MethodImplOptions.NoInlining)]
367 public static void ss6 (bool b) {
370 throw new Exception ();
374 [MethodImplAttribute (MethodImplOptions.NoInlining)]
375 public static void ss6_2 () {
378 [MethodImplAttribute (MethodImplOptions.NoInlining)]
379 public static void ss7 () {
388 [MethodImplAttribute (MethodImplOptions.NoInlining)]
389 public static void ss7_2 () {
392 [MethodImplAttribute (MethodImplOptions.NoInlining)]
393 public static void ss7_3 () {
394 throw new Exception ();
397 [MethodImplAttribute (MethodImplOptions.NoInlining)]
398 public static bool is_even (int i) {
404 Console.WriteLine ("HIT!");
410 [MethodImplAttribute (MethodImplOptions.NoInlining)]
411 public static void arguments () {
412 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));
414 arg2 ("FOO", null, "BLA", ref i, new GClass <int> { field = 42 }, new object ());
415 Tests t = new Tests () { field_i = 42, field_s = "S" };
419 [MethodImplAttribute (MethodImplOptions.NoInlining)]
420 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) {
421 return (int)(sb + b + (bl ? 0 : 1) + s + us + (int)c + i + ui + l + (long)ul + f + d + (int)ip + (int)uip);
424 [MethodImplAttribute (MethodImplOptions.NoInlining)]
425 public static string arg2 (string s, string s3, object o, ref int i, GClass <int> gc, object o2) {
426 return s + (s3 != null ? "" : "") + o + i + gc.field + o2;
429 [MethodImplAttribute (MethodImplOptions.NoInlining)]
430 public object arg3 (string s) {
431 return s + s + s + s + this;
434 [MethodImplAttribute (MethodImplOptions.NoInlining)]
435 public static void objects () {
436 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 };
437 t.o1 (new Tests2 () { field_j = 43 }, new GClass <int> { field = 42 }, new GClass <string> { field = "FOO" });
438 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 });
441 [MethodImplAttribute (MethodImplOptions.NoInlining)]
442 public object o1 (Tests2 t, GClass <int> gc1, GClass <string> gc2) {
443 if (t == null || gc1 == null || gc2 == null)
449 [MethodImplAttribute (MethodImplOptions.NoInlining)]
450 public static string o2 (string[] s2, int[] s3, int[,] s4, int[,] s5, IList<int> s6) {
451 return s2 [0] + s3 [0] + s4 [0, 0] + s6 [0];
454 [MethodImplAttribute (MethodImplOptions.NoInlining)]
455 public static void objrefs () {
456 Tests t = new Tests () {};
464 [MethodImplAttribute (MethodImplOptions.NoInlining)]
465 public static void set_child (Tests t) {
466 t.child = new Tests ();
469 [MethodImplAttribute (MethodImplOptions.NoInlining)]
470 public void objrefs1 () {
473 [MethodImplAttribute (MethodImplOptions.NoInlining)]
474 public static void objrefs2 () {
477 public static void vtypes () {
478 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 }};
479 AStruct s = new AStruct { i = 44, s = "T", k = 45 };
480 AStruct[] arr = new AStruct[] {
481 new AStruct () { i = 1, s = "S1" },
482 new AStruct () { i = 2, s = "S2" } };
488 [MethodImplAttribute (MethodImplOptions.NoInlining)]
489 public object vtypes1 (AStruct s, AStruct[] arr) {
496 [MethodImplAttribute (MethodImplOptions.NoInlining)]
497 public static void vtypes2 (AStruct s) {
501 [MethodImplAttribute (MethodImplOptions.NoInlining)]
502 public static void vtypes3 (AStruct s) {
503 AStruct.static_foo (5);
506 [MethodImplAttribute (MethodImplOptions.NoInlining)]
507 public static void locals () {
510 locals2<string> (null, 5, "ABC", ref s);
515 [MethodImplAttribute (MethodImplOptions.NoInlining)]
516 static void locals11 (double a, ref double b) {
519 [MethodImplAttribute (MethodImplOptions.NoInlining)]
520 public static void locals1 (string[] args) {
524 locals11 (b: ref ri, a: ri);
526 for (int j = 0; j < 10; ++j) {
531 [MethodImplAttribute (MethodImplOptions.NoInlining)]
532 [StateMachine (typeof (int))]
533 public static void locals2<T> (string[] args, int arg, T t, ref string rs) {
537 for (int j = 0; j < 10; ++j) {
546 [MethodImplAttribute (MethodImplOptions.NoInlining)]
547 public static void locals3 () {
567 [MethodImplAttribute (MethodImplOptions.NoInlining)]
568 public static void locals4 () {
571 [MethodImplAttribute (MethodImplOptions.NoInlining)]
572 public static void locals5 () {
575 [MethodImplAttribute (MethodImplOptions.NoInlining)]
576 public static void locals6 () {
579 for (i = 0; i < 10; ++i)
582 for (i = 0; i < 10; ++i)
592 [MethodImplAttribute (MethodImplOptions.NoInlining)]
593 public static void locals6_1 () {
596 [MethodImplAttribute (MethodImplOptions.NoInlining)]
597 public static void locals6_2 (int arg) {
600 [MethodImplAttribute (MethodImplOptions.NoInlining)]
601 public static void locals6_3 () {
602 // Clobber all registers
603 int sum = 0, i, j, k, l, m;
604 for (i = 0; i < 100; ++i)
606 for (j = 0; j < 100; ++j)
608 for (k = 0; k < 100; ++k)
610 for (l = 0; l < 100; ++l)
612 for (m = 0; m < 100; ++m)
616 [MethodImplAttribute (MethodImplOptions.NoInlining)]
617 public static void locals6_4 (int arg) {
620 [MethodImplAttribute (MethodImplOptions.NoInlining)]
621 public static void locals6_5 () {
624 [MethodImplAttribute (MethodImplOptions.NoInlining)]
625 public static void locals6_6 (int arg) {
628 [MethodImplAttribute (MethodImplOptions.NoInlining)]
629 public static void line_numbers () {
633 [MethodImplAttribute (MethodImplOptions.NoInlining)]
634 public static void suspend () {
642 [MethodImplAttribute (MethodImplOptions.NoInlining)]
643 public static void type_info () {
644 Tests t = new Tests () { field_i = 42, field_s = "S", base_field_i = 43, base_field_s = "T", field_enum = AnEnum.B };
645 t.ti1 (new Tests2 () { field_j = 43 }, new GClass <int> { field = 42 }, new GClass <string> { field = "FOO" });
648 AStruct s = new AStruct () { i = 42, s = "S", k = 43 };
650 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);
654 [MethodImplAttribute (MethodImplOptions.NoInlining)]
655 public object ti1 (Tests2 t, GClass <int> gc1, GClass <string> gc2) {
656 if (t == null || gc1 == null || gc2 == null)
662 [MethodImplAttribute (MethodImplOptions.NoInlining)]
663 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) {
664 return s2 [0] + s3 [0] + s4 [0, 0];
667 [MethodImplAttribute (MethodImplOptions.NoInlining)]
668 public static void assembly_load () {
672 [MethodImplAttribute (MethodImplOptions.NoInlining)]
673 public static void assembly_load_2 () {
674 // This will load System.dll while holding the loader lock
678 [MethodImplAttribute (MethodImplOptions.NoInlining)]
679 public static void invoke () {
680 new Tests ().invoke1 (new Tests2 (), new AStruct () { i = 42, j = (IntPtr)43 }, new GStruct<int> { j = 42 });
681 new Tests ().invoke_ex ();
684 [MethodImplAttribute (MethodImplOptions.NoInlining)]
685 public void invoke1 (Tests2 t, AStruct s, GStruct<int> g) {
689 [MethodImplAttribute (MethodImplOptions.NoInlining)]
690 public void invoke2 () {
693 [MethodImplAttribute (MethodImplOptions.NoInlining)]
694 public void invoke_ex () {
698 [MethodImplAttribute (MethodImplOptions.NoInlining)]
699 public void invoke_ex_inner () {
701 throw new Exception ();
708 [MethodImplAttribute (MethodImplOptions.NoInlining)]
709 public void invoke_single_threaded () {
710 // Spawn a thread incrementing a counter
711 bool finished = false;
713 new Thread (delegate () {
720 invoke_single_threaded_2 ();
725 [MethodImplAttribute (MethodImplOptions.NoInlining)]
726 public void invoke_single_threaded_2 () {
729 public void invoke_return_void () {
732 public string invoke_return_ref () {
736 public object invoke_return_null () {
740 public int invoke_return_primitive () {
744 public int? invoke_return_nullable () {
748 public int? invoke_return_nullable_null () {
752 public void invoke_type_load () {
759 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) {
760 return ub + sb + ss + us + i + ui + l + (long)ul + (int)c + (b ? 1 : 0) + (int)f + (int)d;
763 public int invoke_pass_primitive2 (bool b) {
767 public string invoke_pass_ref (string s) {
771 public static string invoke_static_pass_ref (string s) {
775 public static void invoke_static_return_void () {
778 public static void invoke_throws () {
779 throw new Exception ();
782 [MethodImplAttribute (MethodImplOptions.NoInlining)]
783 public static void exceptions () {
785 throw new OverflowException ();
786 } catch (Exception) {
789 throw new OverflowException ();
790 } catch (Exception) {
793 throw new ArgumentException ();
794 } catch (Exception) {
797 throw new OverflowException ();
798 } catch (Exception) {
804 } catch (Exception) {
809 } catch (Exception) {
813 [MethodImplAttribute (MethodImplOptions.NoInlining)]
814 public static void unhandled_exception () {
815 ThreadPool.QueueUserWorkItem (delegate {
816 throw new InvalidOperationException ();
818 Thread.Sleep (10000);
821 [MethodImplAttribute (MethodImplOptions.NoInlining)]
822 public static void unhandled_exception_user () {
824 System.Threading.Tasks.Task.Factory.StartNew (() => {
827 Thread.Sleep (10000);
831 [MethodImplAttribute (MethodImplOptions.NoInlining)]
832 public static void Throw () {
833 throw new Exception ();
836 internal static Delegate create_filter_delegate (Delegate dlg, MethodInfo filter_method)
839 throw new ArgumentNullException ();
840 if (dlg.Target != null)
841 throw new ArgumentException ();
842 if (dlg.Method == null)
843 throw new ArgumentException ();
845 var ret_type = dlg.Method.ReturnType;
846 var param_types = dlg.Method.GetParameters ().Select (x => x.ParameterType).ToArray ();
848 var dynamic = new DynamicMethod (Guid.NewGuid ().ToString (), ret_type, param_types, typeof (object), true);
849 var ig = dynamic.GetILGenerator ();
851 LocalBuilder retval = null;
852 if (ret_type != typeof (void))
853 retval = ig.DeclareLocal (ret_type);
855 var label = ig.BeginExceptionBlock ();
857 for (int i = 0; i < param_types.Length; i++)
858 ig.Emit (OpCodes.Ldarg, i);
859 ig.Emit (OpCodes.Call, dlg.Method);
862 ig.Emit (OpCodes.Stloc, retval);
864 ig.Emit (OpCodes.Leave, label);
866 ig.BeginExceptFilterBlock ();
868 ig.Emit (OpCodes.Call, filter_method);
870 ig.BeginCatchBlock (null);
872 ig.Emit (OpCodes.Pop);
874 ig.EndExceptionBlock ();
877 ig.Emit (OpCodes.Ldloc, retval);
879 ig.Emit (OpCodes.Ret);
881 return dynamic.CreateDelegate (dlg.GetType ());
884 [MethodImplAttribute (MethodImplOptions.NoInlining)]
885 static void exception_filter_method () {
886 throw new InvalidOperationException ();
889 [MethodImplAttribute (MethodImplOptions.NoInlining)]
890 static int exception_filter_filter (Exception exc) {
894 [MethodImplAttribute (MethodImplOptions.NoInlining)]
895 public static void exception_filter () {
896 var method = typeof (Tests).GetMethod (
897 "exception_filter_method", BindingFlags.NonPublic | BindingFlags.Static);
898 var filter_method = typeof (Tests).GetMethod (
899 "exception_filter_filter", BindingFlags.NonPublic | BindingFlags.Static);
901 var dlg = Delegate.CreateDelegate (typeof (Action), method);
903 var wrapper = (Action) create_filter_delegate (dlg, filter_method);
908 [MethodImplAttribute (MethodImplOptions.NoInlining)]
909 public static bool return_true () {
913 [MethodImplAttribute (MethodImplOptions.NoInlining)]
914 public static void exceptions2 () {
916 throw new Exception ();
917 Console.WriteLine ();
920 [MethodImplAttribute (MethodImplOptions.NoInlining)]
921 public static void threads () {
922 Thread t = new Thread (delegate () {});
928 [MethodImplAttribute (MethodImplOptions.NoInlining)]
929 public static void domains () {
930 AppDomain domain = AppDomain.CreateDomain ("domain");
932 CrossDomain o = (CrossDomain)domain.CreateInstanceAndUnwrap (
933 typeof (CrossDomain).Assembly.FullName, "CrossDomain");
935 domains_2 (o, new CrossDomain ());
943 AppDomain.Unload (domain);
948 [MethodImplAttribute (MethodImplOptions.NoInlining)]
949 public static void domains_2 (object o, object o2) {
952 [MethodImplAttribute (MethodImplOptions.NoInlining)]
953 public static void domains_3 () {
956 [MethodImplAttribute (MethodImplOptions.NoInlining)]
957 public static void invoke_in_domain () {
960 [MethodImplAttribute (MethodImplOptions.NoInlining)]
961 public static void invoke_in_domain_2 () {
964 [MethodImplAttribute (MethodImplOptions.NoInlining)]
965 public static void dynamic_methods () {
966 var m = new DynamicMethod ("dyn_method", typeof (void), new Type [] { typeof (int) }, typeof (object).Module);
967 var ig = m.GetILGenerator ();
969 ig.Emit (OpCodes.Ldstr, "FOO");
970 ig.Emit (OpCodes.Call, typeof (Tests).GetMethod ("dyn_call"));
971 ig.Emit (OpCodes.Ret);
973 var del = (Action<int>)m.CreateDelegate (typeof (Action<int>));
978 public static void dyn_call (string s) {
981 [MethodImplAttribute (MethodImplOptions.NoInlining)]
982 public static void ref_emit () {
983 AssemblyName assemblyName = new AssemblyName ();
984 assemblyName.Name = "foo";
986 AssemblyBuilder assembly =
987 Thread.GetDomain ().DefineDynamicAssembly (
988 assemblyName, AssemblyBuilderAccess.RunAndSave);
990 ModuleBuilder module = assembly.DefineDynamicModule ("foo.dll");
992 TypeBuilder tb = module.DefineType ("foo", TypeAttributes.Public, typeof (object));
993 MethodBuilder mb = tb.DefineMethod ("ref_emit_method", MethodAttributes.Public|MethodAttributes.Static, CallingConventions.Standard, typeof (void), new Type [] { });
994 ILGenerator ig = mb.GetILGenerator ();
995 ig.Emit (OpCodes.Ldstr, "FOO");
996 ig.Emit (OpCodes.Call, typeof (Tests).GetMethod ("ref_emit_call"));
997 ig.Emit (OpCodes.Ret);
999 Type t = tb.CreateType ();
1001 t.GetMethod ("ref_emit_method").Invoke (null, null);
1004 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1005 public static void ref_emit_call (string s) {
1008 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1009 public static void frames_in_native () {
1011 object mon = new object ();
1012 ThreadPool.QueueUserWorkItem (delegate {
1013 frames_in_native_2 ();
1015 Monitor.Pulse (mon);
1023 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1024 static void frames_in_native_2 () {
1025 frames_in_native_3 ();
1028 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1029 static void frames_in_native_3 () {
1032 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1033 public static void string_call (string s) {
1036 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1037 public static void ss_regress_654694 () {
1044 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1045 public static void user () {
1048 Debugger.Log (5, Debugger.IsLogging () ? "A" : "", "B");
1051 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1052 public static void type_load () {
1056 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1057 static void type_load_2 () {
1058 var c1 = new Dictionary<int, int> ();
1060 var c = new TypeLoadClass ();
1062 var c2 = new TypeLoadClass2 ();
1066 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1067 public static void regress () {
1068 regress_2755 (DateTime.Now);
1071 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1072 public static unsafe void regress_2755 (DateTime d) {
1073 int* buffer = stackalloc int [128];
1078 for (int i = 0; i < 128; ++i)
1081 regress_2755_3 (sum);
1084 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1085 public static void regress_2755_2 () {
1088 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1089 public static void regress_2755_3 (int sum) {
1092 static object gc_suspend_field;
1094 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1095 static unsafe void set_gc_suspend_field () {
1096 set_gc_suspend_field_2 ();
1098 int* buffer = stackalloc int [4096];
1101 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1102 static void set_gc_suspend_field_2 () {
1103 gc_suspend_field = new object ();
1106 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1107 static void gc_suspend_1 () {
1110 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1111 public static void gc_suspend_invoke () {
1112 gc_suspend_field = null;
1114 GC.WaitForPendingFinalizers ();
1117 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1118 public static void gc_suspend () {
1119 set_gc_suspend_field ();
1124 class TypeLoadClass {
1127 class TypeLoadClass2 {
1130 public class CrossDomain : MarshalByRefObject
1132 public void invoke () {
1133 Tests.invoke_in_domain ();
1136 public void invoke_2 () {
1137 Tests.invoke_in_domain_2 ();
1140 public int invoke_3 () {
1147 public ProcessStartInfo info;
1150 // Class used for line number info testing, don't change its layout
1151 public class LineNumbers
1153 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1154 public static void ln1 () {
1160 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1161 public static void ln2 () {
1164 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1165 public static void ln3 () {
1166 #pragma warning disable 0219
1168 #pragma warning restore 0219