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 public static void locals1 (string[] args) {
519 for (int j = 0; j < 10; ++j) {
524 [MethodImplAttribute (MethodImplOptions.NoInlining)]
525 [StateMachine (typeof (int))]
526 public static void locals2<T> (string[] args, int arg, T t, ref string rs) {
530 for (int j = 0; j < 10; ++j) {
539 [MethodImplAttribute (MethodImplOptions.NoInlining)]
540 public static void locals3 () {
560 [MethodImplAttribute (MethodImplOptions.NoInlining)]
561 public static void locals4 () {
564 [MethodImplAttribute (MethodImplOptions.NoInlining)]
565 public static void locals5 () {
568 [MethodImplAttribute (MethodImplOptions.NoInlining)]
569 public static void locals6 () {
572 for (i = 0; i < 10; ++i)
575 for (i = 0; i < 10; ++i)
585 [MethodImplAttribute (MethodImplOptions.NoInlining)]
586 public static void locals6_1 () {
589 [MethodImplAttribute (MethodImplOptions.NoInlining)]
590 public static void locals6_2 (int arg) {
593 [MethodImplAttribute (MethodImplOptions.NoInlining)]
594 public static void locals6_3 () {
595 // Clobber all registers
596 int sum = 0, i, j, k, l, m;
597 for (i = 0; i < 100; ++i)
599 for (j = 0; j < 100; ++j)
601 for (k = 0; k < 100; ++k)
603 for (l = 0; l < 100; ++l)
605 for (m = 0; m < 100; ++m)
609 [MethodImplAttribute (MethodImplOptions.NoInlining)]
610 public static void locals6_4 (int arg) {
613 [MethodImplAttribute (MethodImplOptions.NoInlining)]
614 public static void locals6_5 () {
617 [MethodImplAttribute (MethodImplOptions.NoInlining)]
618 public static void locals6_6 (int arg) {
621 [MethodImplAttribute (MethodImplOptions.NoInlining)]
622 public static void line_numbers () {
626 [MethodImplAttribute (MethodImplOptions.NoInlining)]
627 public static void suspend () {
635 [MethodImplAttribute (MethodImplOptions.NoInlining)]
636 public static void type_info () {
637 Tests t = new Tests () { field_i = 42, field_s = "S", base_field_i = 43, base_field_s = "T", field_enum = AnEnum.B };
638 t.ti1 (new Tests2 () { field_j = 43 }, new GClass <int> { field = 42 }, new GClass <string> { field = "FOO" });
641 AStruct s = new AStruct () { i = 42, s = "S", k = 43 };
643 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);
647 [MethodImplAttribute (MethodImplOptions.NoInlining)]
648 public object ti1 (Tests2 t, GClass <int> gc1, GClass <string> gc2) {
649 if (t == null || gc1 == null || gc2 == null)
655 [MethodImplAttribute (MethodImplOptions.NoInlining)]
656 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) {
657 return s2 [0] + s3 [0] + s4 [0, 0];
660 [MethodImplAttribute (MethodImplOptions.NoInlining)]
661 public static void assembly_load () {
665 [MethodImplAttribute (MethodImplOptions.NoInlining)]
666 public static void assembly_load_2 () {
667 // This will load System.dll while holding the loader lock
671 [MethodImplAttribute (MethodImplOptions.NoInlining)]
672 public static void invoke () {
673 new Tests ().invoke1 (new Tests2 (), new AStruct () { i = 42, j = (IntPtr)43 }, new GStruct<int> { j = 42 });
674 new Tests ().invoke_ex ();
677 [MethodImplAttribute (MethodImplOptions.NoInlining)]
678 public void invoke1 (Tests2 t, AStruct s, GStruct<int> g) {
682 [MethodImplAttribute (MethodImplOptions.NoInlining)]
683 public void invoke2 () {
686 [MethodImplAttribute (MethodImplOptions.NoInlining)]
687 public void invoke_ex () {
691 [MethodImplAttribute (MethodImplOptions.NoInlining)]
692 public void invoke_ex_inner () {
694 throw new Exception ();
701 [MethodImplAttribute (MethodImplOptions.NoInlining)]
702 public void invoke_single_threaded () {
703 // Spawn a thread incrementing a counter
704 bool finished = false;
706 new Thread (delegate () {
713 invoke_single_threaded_2 ();
718 [MethodImplAttribute (MethodImplOptions.NoInlining)]
719 public void invoke_single_threaded_2 () {
722 public void invoke_return_void () {
725 public string invoke_return_ref () {
729 public object invoke_return_null () {
733 public int invoke_return_primitive () {
737 public int? invoke_return_nullable () {
741 public int? invoke_return_nullable_null () {
745 public void invoke_type_load () {
752 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) {
753 return ub + sb + ss + us + i + ui + l + (long)ul + (int)c + (b ? 1 : 0) + (int)f + (int)d;
756 public int invoke_pass_primitive2 (bool b) {
760 public string invoke_pass_ref (string s) {
764 public static string invoke_static_pass_ref (string s) {
768 public static void invoke_static_return_void () {
771 public static void invoke_throws () {
772 throw new Exception ();
775 [MethodImplAttribute (MethodImplOptions.NoInlining)]
776 public static void exceptions () {
778 throw new OverflowException ();
779 } catch (Exception) {
782 throw new OverflowException ();
783 } catch (Exception) {
786 throw new ArgumentException ();
787 } catch (Exception) {
790 throw new OverflowException ();
791 } catch (Exception) {
797 } catch (Exception) {
802 } catch (Exception) {
806 [MethodImplAttribute (MethodImplOptions.NoInlining)]
807 public static void unhandled_exception () {
808 ThreadPool.QueueUserWorkItem (delegate {
809 throw new InvalidOperationException ();
811 Thread.Sleep (10000);
814 [MethodImplAttribute (MethodImplOptions.NoInlining)]
815 public static void unhandled_exception_user () {
817 System.Threading.Tasks.Task.Factory.StartNew (() => {
820 Thread.Sleep (10000);
824 [MethodImplAttribute (MethodImplOptions.NoInlining)]
825 public static void Throw () {
826 throw new Exception ();
829 internal static Delegate create_filter_delegate (Delegate dlg, MethodInfo filter_method)
832 throw new ArgumentNullException ();
833 if (dlg.Target != null)
834 throw new ArgumentException ();
835 if (dlg.Method == null)
836 throw new ArgumentException ();
838 var ret_type = dlg.Method.ReturnType;
839 var param_types = dlg.Method.GetParameters ().Select (x => x.ParameterType).ToArray ();
841 var dynamic = new DynamicMethod (Guid.NewGuid ().ToString (), ret_type, param_types, typeof (object), true);
842 var ig = dynamic.GetILGenerator ();
844 LocalBuilder retval = null;
845 if (ret_type != typeof (void))
846 retval = ig.DeclareLocal (ret_type);
848 var label = ig.BeginExceptionBlock ();
850 for (int i = 0; i < param_types.Length; i++)
851 ig.Emit (OpCodes.Ldarg, i);
852 ig.Emit (OpCodes.Call, dlg.Method);
855 ig.Emit (OpCodes.Stloc, retval);
857 ig.Emit (OpCodes.Leave, label);
859 ig.BeginExceptFilterBlock ();
861 ig.Emit (OpCodes.Call, filter_method);
863 ig.BeginCatchBlock (null);
865 ig.Emit (OpCodes.Pop);
867 ig.EndExceptionBlock ();
870 ig.Emit (OpCodes.Ldloc, retval);
872 ig.Emit (OpCodes.Ret);
874 return dynamic.CreateDelegate (dlg.GetType ());
877 [MethodImplAttribute (MethodImplOptions.NoInlining)]
878 static void exception_filter_method () {
879 throw new InvalidOperationException ();
882 [MethodImplAttribute (MethodImplOptions.NoInlining)]
883 static int exception_filter_filter (Exception exc) {
887 [MethodImplAttribute (MethodImplOptions.NoInlining)]
888 public static void exception_filter () {
889 var method = typeof (Tests).GetMethod (
890 "exception_filter_method", BindingFlags.NonPublic | BindingFlags.Static);
891 var filter_method = typeof (Tests).GetMethod (
892 "exception_filter_filter", BindingFlags.NonPublic | BindingFlags.Static);
894 var dlg = Delegate.CreateDelegate (typeof (Action), method);
896 var wrapper = (Action) create_filter_delegate (dlg, filter_method);
901 [MethodImplAttribute (MethodImplOptions.NoInlining)]
902 public static bool return_true () {
906 [MethodImplAttribute (MethodImplOptions.NoInlining)]
907 public static void exceptions2 () {
909 throw new Exception ();
910 Console.WriteLine ();
913 [MethodImplAttribute (MethodImplOptions.NoInlining)]
914 public static void threads () {
915 Thread t = new Thread (delegate () {});
921 [MethodImplAttribute (MethodImplOptions.NoInlining)]
922 public static void domains () {
923 AppDomain domain = AppDomain.CreateDomain ("domain");
925 CrossDomain o = (CrossDomain)domain.CreateInstanceAndUnwrap (
926 typeof (CrossDomain).Assembly.FullName, "CrossDomain");
928 domains_2 (o, new CrossDomain ());
936 AppDomain.Unload (domain);
941 [MethodImplAttribute (MethodImplOptions.NoInlining)]
942 public static void domains_2 (object o, object o2) {
945 [MethodImplAttribute (MethodImplOptions.NoInlining)]
946 public static void domains_3 () {
949 [MethodImplAttribute (MethodImplOptions.NoInlining)]
950 public static void invoke_in_domain () {
953 [MethodImplAttribute (MethodImplOptions.NoInlining)]
954 public static void invoke_in_domain_2 () {
957 [MethodImplAttribute (MethodImplOptions.NoInlining)]
958 public static void dynamic_methods () {
959 var m = new DynamicMethod ("dyn_method", typeof (void), new Type [] { typeof (int) }, typeof (object).Module);
960 var ig = m.GetILGenerator ();
962 ig.Emit (OpCodes.Ldstr, "FOO");
963 ig.Emit (OpCodes.Call, typeof (Tests).GetMethod ("dyn_call"));
964 ig.Emit (OpCodes.Ret);
966 var del = (Action<int>)m.CreateDelegate (typeof (Action<int>));
971 public static void dyn_call (string s) {
974 [MethodImplAttribute (MethodImplOptions.NoInlining)]
975 public static void ref_emit () {
976 AssemblyName assemblyName = new AssemblyName ();
977 assemblyName.Name = "foo";
979 AssemblyBuilder assembly =
980 Thread.GetDomain ().DefineDynamicAssembly (
981 assemblyName, AssemblyBuilderAccess.RunAndSave);
983 ModuleBuilder module = assembly.DefineDynamicModule ("foo.dll");
985 TypeBuilder tb = module.DefineType ("foo", TypeAttributes.Public, typeof (object));
986 MethodBuilder mb = tb.DefineMethod ("ref_emit_method", MethodAttributes.Public|MethodAttributes.Static, CallingConventions.Standard, typeof (void), new Type [] { });
987 ILGenerator ig = mb.GetILGenerator ();
988 ig.Emit (OpCodes.Ldstr, "FOO");
989 ig.Emit (OpCodes.Call, typeof (Tests).GetMethod ("ref_emit_call"));
990 ig.Emit (OpCodes.Ret);
992 Type t = tb.CreateType ();
994 t.GetMethod ("ref_emit_method").Invoke (null, null);
997 [MethodImplAttribute (MethodImplOptions.NoInlining)]
998 public static void ref_emit_call (string s) {
1001 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1002 public static void frames_in_native () {
1004 object mon = new object ();
1005 ThreadPool.QueueUserWorkItem (delegate {
1006 frames_in_native_2 ();
1008 Monitor.Pulse (mon);
1016 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1017 static void frames_in_native_2 () {
1018 frames_in_native_3 ();
1021 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1022 static void frames_in_native_3 () {
1025 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1026 public static void string_call (string s) {
1029 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1030 public static void ss_regress_654694 () {
1037 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1038 public static void user () {
1041 Debugger.Log (5, Debugger.IsLogging () ? "A" : "", "B");
1044 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1045 public static void type_load () {
1049 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1050 static void type_load_2 () {
1051 var c1 = new Dictionary<int, int> ();
1053 var c = new TypeLoadClass ();
1055 var c2 = new TypeLoadClass2 ();
1059 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1060 public static void regress () {
1061 regress_2755 (DateTime.Now);
1064 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1065 public static unsafe void regress_2755 (DateTime d) {
1066 int* buffer = stackalloc int [128];
1071 for (int i = 0; i < 128; ++i)
1074 regress_2755_3 (sum);
1077 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1078 public static void regress_2755_2 () {
1081 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1082 public static void regress_2755_3 (int sum) {
1085 static object gc_suspend_field;
1087 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1088 static unsafe void set_gc_suspend_field () {
1089 set_gc_suspend_field_2 ();
1091 int* buffer = stackalloc int [4096];
1094 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1095 static void set_gc_suspend_field_2 () {
1096 gc_suspend_field = new object ();
1099 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1100 static void gc_suspend_1 () {
1103 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1104 public static void gc_suspend_invoke () {
1105 gc_suspend_field = null;
1107 GC.WaitForPendingFinalizers ();
1110 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1111 public static void gc_suspend () {
1112 set_gc_suspend_field ();
1117 class TypeLoadClass {
1120 class TypeLoadClass2 {
1123 public class CrossDomain : MarshalByRefObject
1125 public void invoke () {
1126 Tests.invoke_in_domain ();
1129 public void invoke_2 () {
1130 Tests.invoke_in_domain_2 ();
1133 public int invoke_3 () {
1140 public ProcessStartInfo info;
1143 // Class used for line number info testing, don't change its layout
1144 public class LineNumbers
1146 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1147 public static void ln1 () {
1153 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1154 public static void ln2 () {
1157 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1158 public static void ln3 () {
1159 #pragma warning disable 0219
1161 #pragma warning restore 0219