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 void wait_one ()
228 ManualResetEvent evt = new ManualResetEvent (false);
232 public static int Main (String[] args) {
235 if (args.Length > 0 && args [0] == "suspend-test")
236 /* This contains an infinite loop, so execute it conditionally */
238 if (args.Length >0 && args [0] == "unhandled-exception") {
239 unhandled_exception ();
242 if (args.Length >0 && args [0] == "unhandled-exception-endinvoke") {
243 unhandled_exception_endinvoke ();
246 if (args.Length >0 && args [0] == "unhandled-exception-user") {
247 unhandled_exception_user ();
250 if (args.Length >0 && args [0] == "wait-one") {
273 if (args.Length > 0 && args [0] == "domain-test")
274 /* This takes a lot of time, so execute it conditionally */
276 if (args.Length > 0 && args [0] == "ref-emit-test")
278 if (args.Length > 0 && args [0] == "frames-in-native")
280 if (args.Length > 0 && args [0] == "invoke-single-threaded")
281 new Tests ().invoke_single_threaded ();
285 public static void breakpoints () {
286 /* Call these early so it is JITted by the time a breakpoint is placed on it */
298 bp6<string> (new GClass <int> ());
303 [MethodImplAttribute (MethodImplOptions.NoInlining)]
304 public static void bp1 () {
307 [MethodImplAttribute (MethodImplOptions.NoInlining)]
308 public static void bp2 () {
311 [MethodImplAttribute (MethodImplOptions.NoInlining)]
312 public static void bp3 () {
315 [MethodImplAttribute (MethodImplOptions.NoInlining)]
316 public static void bp4 () {
319 [MethodImplAttribute (MethodImplOptions.NoInlining)]
320 public static void bp5 () {
323 [MethodImplAttribute (MethodImplOptions.NoInlining)]
324 public static void bp6<T> (GClass<int> gc) {
328 [MethodImplAttribute (MethodImplOptions.NoInlining)]
329 public static void bp7<T> () {
332 [MethodImplAttribute (MethodImplOptions.NoInlining)]
333 public static void single_stepping () {
340 ss5 (new int [] { 1, 2, 3 }, new Func<int, bool> (is_even));
346 ss_regress_654694 ();
349 [MethodImplAttribute (MethodImplOptions.NoInlining)]
350 public static void ss1 () {
353 [MethodImplAttribute (MethodImplOptions.NoInlining)]
354 public static void ss2 () {
357 [MethodImplAttribute (MethodImplOptions.NoInlining)]
358 public static int ss3 () {
361 for (int i = 0; i < 10; ++i)
367 [MethodImplAttribute (MethodImplOptions.NoInlining)]
368 public static void ss3_2 () {
372 [MethodImplAttribute (MethodImplOptions.NoInlining)]
373 public static void ss3_2_2 () {
376 [MethodImplAttribute (MethodImplOptions.NoInlining)]
377 public static int ss4 () {
383 [MethodImplAttribute (MethodImplOptions.NoInlining)]
384 public static void ss5 (int[] arr, Func<int, bool> selector) {
385 // Call into linq which calls back into this assembly
386 arr.Count (selector);
389 [MethodImplAttribute (MethodImplOptions.NoInlining)]
390 public static void ss6 (bool b) {
393 throw new Exception ();
397 [MethodImplAttribute (MethodImplOptions.NoInlining)]
398 public static void ss6_2 () {
401 [MethodImplAttribute (MethodImplOptions.NoInlining)]
402 public static void ss7 () {
411 [MethodImplAttribute (MethodImplOptions.NoInlining)]
412 public static void ss7_2 () {
415 [MethodImplAttribute (MethodImplOptions.NoInlining)]
416 public static void ss7_3 () {
417 throw new Exception ();
420 [MethodImplAttribute (MethodImplOptions.NoInlining)]
421 public static bool is_even (int i) {
427 Console.WriteLine ("HIT!");
433 [MethodImplAttribute (MethodImplOptions.NoInlining)]
434 public static void arguments () {
435 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));
437 arg2 ("FOO", null, "BLA", ref i, new GClass <int> { field = 42 }, new object ());
438 Tests t = new Tests () { field_i = 42, field_s = "S" };
442 [MethodImplAttribute (MethodImplOptions.NoInlining)]
443 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) {
444 return (int)(sb + b + (bl ? 0 : 1) + s + us + (int)c + i + ui + l + (long)ul + f + d + (int)ip + (int)uip);
447 [MethodImplAttribute (MethodImplOptions.NoInlining)]
448 public static string arg2 (string s, string s3, object o, ref int i, GClass <int> gc, object o2) {
449 return s + (s3 != null ? "" : "") + o + i + gc.field + o2;
452 [MethodImplAttribute (MethodImplOptions.NoInlining)]
453 public object arg3 (string s) {
454 return s + s + s + s + this;
457 [MethodImplAttribute (MethodImplOptions.NoInlining)]
458 public static void objects () {
459 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 };
460 t.o1 (new Tests2 () { field_j = 43 }, new GClass <int> { field = 42 }, new GClass <string> { field = "FOO" });
461 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 });
464 [MethodImplAttribute (MethodImplOptions.NoInlining)]
465 public object o1 (Tests2 t, GClass <int> gc1, GClass <string> gc2) {
466 if (t == null || gc1 == null || gc2 == null)
472 [MethodImplAttribute (MethodImplOptions.NoInlining)]
473 public static string o2 (string[] s2, int[] s3, int[,] s4, int[,] s5, IList<int> s6) {
474 return s2 [0] + s3 [0] + s4 [0, 0] + s6 [0];
477 [MethodImplAttribute (MethodImplOptions.NoInlining)]
478 public static void objrefs () {
479 Tests t = new Tests () {};
487 [MethodImplAttribute (MethodImplOptions.NoInlining)]
488 public static void set_child (Tests t) {
489 t.child = new Tests ();
492 [MethodImplAttribute (MethodImplOptions.NoInlining)]
493 public void objrefs1 () {
496 [MethodImplAttribute (MethodImplOptions.NoInlining)]
497 public static void objrefs2 () {
500 public static void vtypes () {
501 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 }};
502 AStruct s = new AStruct { i = 44, s = "T", k = 45 };
503 AStruct[] arr = new AStruct[] {
504 new AStruct () { i = 1, s = "S1" },
505 new AStruct () { i = 2, s = "S2" } };
511 [MethodImplAttribute (MethodImplOptions.NoInlining)]
512 public object vtypes1 (AStruct s, AStruct[] arr) {
519 [MethodImplAttribute (MethodImplOptions.NoInlining)]
520 public static void vtypes2 (AStruct s) {
524 [MethodImplAttribute (MethodImplOptions.NoInlining)]
525 public static void vtypes3 (AStruct s) {
526 AStruct.static_foo (5);
529 [MethodImplAttribute (MethodImplOptions.NoInlining)]
530 public static void locals () {
533 locals2<string> (null, 5, "ABC", ref s);
539 [MethodImplAttribute (MethodImplOptions.NoInlining)]
540 static void locals11 (double a, ref double b) {
543 [MethodImplAttribute (MethodImplOptions.NoInlining)]
544 public static void locals1 (string[] args) {
548 locals11 (b: ref ri, a: ri);
550 for (int j = 0; j < 10; ++j) {
555 [MethodImplAttribute (MethodImplOptions.NoInlining)]
556 [StateMachine (typeof (int))]
557 public static void locals2<T> (string[] args, int arg, T t, ref string rs) {
561 for (int j = 0; j < 10; ++j) {
570 [MethodImplAttribute (MethodImplOptions.NoInlining)]
571 public static void locals3 () {
591 [MethodImplAttribute (MethodImplOptions.NoInlining)]
592 public static void locals4 () {
595 [MethodImplAttribute (MethodImplOptions.NoInlining)]
596 public static void locals5 () {
599 [MethodImplAttribute (MethodImplOptions.NoInlining)]
600 public static void locals6 () {
603 for (i = 0; i < 10; ++i)
606 for (i = 0; i < 10; ++i)
616 [MethodImplAttribute (MethodImplOptions.NoInlining)]
617 public static void locals6_1 () {
620 [MethodImplAttribute (MethodImplOptions.NoInlining)]
621 public static void locals6_2 (int arg) {
624 [MethodImplAttribute (MethodImplOptions.NoInlining)]
625 public static void locals6_3 () {
626 // Clobber all registers
627 int sum = 0, i, j, k, l, m;
628 for (i = 0; i < 100; ++i)
630 for (j = 0; j < 100; ++j)
632 for (k = 0; k < 100; ++k)
634 for (l = 0; l < 100; ++l)
636 for (m = 0; m < 100; ++m)
640 [MethodImplAttribute (MethodImplOptions.NoInlining)]
641 public static void locals6_4 (int arg) {
644 [MethodImplAttribute (MethodImplOptions.NoInlining)]
645 public static void locals6_5 () {
648 [MethodImplAttribute (MethodImplOptions.NoInlining)]
649 public static void locals6_6 (int arg) {
652 [MethodImplAttribute (MethodImplOptions.NoInlining)]
653 public static void locals7<T> (T arg) {
658 [MethodImplAttribute (MethodImplOptions.NoInlining)]
659 public static void line_numbers () {
663 [MethodImplAttribute (MethodImplOptions.NoInlining)]
664 public static void suspend () {
672 [MethodImplAttribute (MethodImplOptions.NoInlining)]
673 public static void type_info () {
674 Tests t = new Tests () { field_i = 42, field_s = "S", base_field_i = 43, base_field_s = "T", field_enum = AnEnum.B };
675 t.ti1 (new Tests2 () { field_j = 43 }, new GClass <int> { field = 42 }, new GClass <string> { field = "FOO" });
678 AStruct s = new AStruct () { i = 42, s = "S", k = 43 };
680 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);
684 [MethodImplAttribute (MethodImplOptions.NoInlining)]
685 public object ti1 (Tests2 t, GClass <int> gc1, GClass <string> gc2) {
686 if (t == null || gc1 == null || gc2 == null)
692 [MethodImplAttribute (MethodImplOptions.NoInlining)]
693 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) {
694 return s2 [0] + s3 [0] + s4 [0, 0];
697 [MethodImplAttribute (MethodImplOptions.NoInlining)]
698 public static void assembly_load () {
702 [MethodImplAttribute (MethodImplOptions.NoInlining)]
703 public static void assembly_load_2 () {
704 // This will load System.dll while holding the loader lock
708 [MethodImplAttribute (MethodImplOptions.NoInlining)]
709 public static void invoke () {
710 new Tests ().invoke1 (new Tests2 (), new AStruct () { i = 42, j = (IntPtr)43 }, new GStruct<int> { j = 42 });
711 new Tests ().invoke_ex ();
714 [MethodImplAttribute (MethodImplOptions.NoInlining)]
715 public void invoke1 (Tests2 t, AStruct s, GStruct<int> g) {
719 [MethodImplAttribute (MethodImplOptions.NoInlining)]
720 public void invoke2 () {
723 [MethodImplAttribute (MethodImplOptions.NoInlining)]
724 public void invoke_ex () {
728 [MethodImplAttribute (MethodImplOptions.NoInlining)]
729 public void invoke_ex_inner () {
731 throw new Exception ();
738 [MethodImplAttribute (MethodImplOptions.NoInlining)]
739 public void invoke_single_threaded () {
740 // Spawn a thread incrementing a counter
741 bool finished = false;
743 new Thread (delegate () {
750 invoke_single_threaded_2 ();
755 [MethodImplAttribute (MethodImplOptions.NoInlining)]
756 public void invoke_single_threaded_2 () {
759 public void invoke_return_void () {
762 public string invoke_return_ref () {
766 public object invoke_return_null () {
770 public int invoke_return_primitive () {
774 public int? invoke_return_nullable () {
778 public int? invoke_return_nullable_null () {
782 public void invoke_type_load () {
789 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) {
790 return ub + sb + ss + us + i + ui + l + (long)ul + (int)c + (b ? 1 : 0) + (int)f + (int)d;
793 public int invoke_pass_primitive2 (bool b) {
797 public string invoke_pass_ref (string s) {
801 public static string invoke_static_pass_ref (string s) {
805 public static void invoke_static_return_void () {
808 public static void invoke_throws () {
809 throw new Exception ();
812 [MethodImplAttribute (MethodImplOptions.NoInlining)]
813 public static void exceptions () {
815 throw new OverflowException ();
816 } catch (Exception) {
819 throw new OverflowException ();
820 } catch (Exception) {
823 throw new ArgumentException ();
824 } catch (Exception) {
827 throw new OverflowException ();
828 } catch (Exception) {
834 } catch (Exception) {
839 } catch (Exception) {
843 [MethodImplAttribute (MethodImplOptions.NoInlining)]
844 public static void unhandled_exception () {
845 ThreadPool.QueueUserWorkItem (delegate {
846 throw new InvalidOperationException ();
848 Thread.Sleep (10000);
851 [MethodImplAttribute (MethodImplOptions.NoInlining)]
852 public static void unhandled_exception_endinvoke_2 () {
855 [MethodImplAttribute (MethodImplOptions.NoInlining)]
856 public static void unhandled_exception_endinvoke () {
857 Action action = new Action (() =>
859 throw new Exception ("thrown");
861 action.BeginInvoke ((ar) => {
863 action.EndInvoke (ar);
864 } catch (Exception ex) {
865 //Console.WriteLine (ex);
869 unhandled_exception_endinvoke_2 ();
872 [MethodImplAttribute (MethodImplOptions.NoInlining)]
873 public static void unhandled_exception_user () {
875 System.Threading.Tasks.Task.Factory.StartNew (() => {
878 Thread.Sleep (10000);
882 [MethodImplAttribute (MethodImplOptions.NoInlining)]
883 public static void Throw () {
884 throw new Exception ();
887 internal static Delegate create_filter_delegate (Delegate dlg, MethodInfo filter_method)
890 throw new ArgumentNullException ();
891 if (dlg.Target != null)
892 throw new ArgumentException ();
893 if (dlg.Method == null)
894 throw new ArgumentException ();
896 var ret_type = dlg.Method.ReturnType;
897 var param_types = dlg.Method.GetParameters ().Select (x => x.ParameterType).ToArray ();
899 var dynamic = new DynamicMethod (Guid.NewGuid ().ToString (), ret_type, param_types, typeof (object), true);
900 var ig = dynamic.GetILGenerator ();
902 LocalBuilder retval = null;
903 if (ret_type != typeof (void))
904 retval = ig.DeclareLocal (ret_type);
906 var label = ig.BeginExceptionBlock ();
908 for (int i = 0; i < param_types.Length; i++)
909 ig.Emit (OpCodes.Ldarg, i);
910 ig.Emit (OpCodes.Call, dlg.Method);
913 ig.Emit (OpCodes.Stloc, retval);
915 ig.Emit (OpCodes.Leave, label);
917 ig.BeginExceptFilterBlock ();
919 ig.Emit (OpCodes.Call, filter_method);
921 ig.BeginCatchBlock (null);
923 ig.Emit (OpCodes.Pop);
925 ig.EndExceptionBlock ();
928 ig.Emit (OpCodes.Ldloc, retval);
930 ig.Emit (OpCodes.Ret);
932 return dynamic.CreateDelegate (dlg.GetType ());
935 [MethodImplAttribute (MethodImplOptions.NoInlining)]
936 static void exception_filter_method () {
937 throw new InvalidOperationException ();
940 [MethodImplAttribute (MethodImplOptions.NoInlining)]
941 static int exception_filter_filter (Exception exc) {
945 [MethodImplAttribute (MethodImplOptions.NoInlining)]
946 public static void exception_filter () {
947 var method = typeof (Tests).GetMethod (
948 "exception_filter_method", BindingFlags.NonPublic | BindingFlags.Static);
949 var filter_method = typeof (Tests).GetMethod (
950 "exception_filter_filter", BindingFlags.NonPublic | BindingFlags.Static);
952 var dlg = Delegate.CreateDelegate (typeof (Action), method);
954 var wrapper = (Action) create_filter_delegate (dlg, filter_method);
959 [MethodImplAttribute (MethodImplOptions.NoInlining)]
960 public static bool return_true () {
964 [MethodImplAttribute (MethodImplOptions.NoInlining)]
965 public static void exceptions2 () {
967 throw new Exception ();
968 Console.WriteLine ();
971 [MethodImplAttribute (MethodImplOptions.NoInlining)]
972 public static void threads () {
973 Thread t = new Thread (delegate () {});
979 [MethodImplAttribute (MethodImplOptions.NoInlining)]
980 public static void domains () {
981 AppDomain domain = AppDomain.CreateDomain ("domain");
983 CrossDomain o = (CrossDomain)domain.CreateInstanceAndUnwrap (
984 typeof (CrossDomain).Assembly.FullName, "CrossDomain");
986 domains_2 (o, new CrossDomain ());
994 AppDomain.Unload (domain);
999 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1000 public static void domains_2 (object o, object o2) {
1003 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1004 public static void domains_3 () {
1007 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1008 public static void invoke_in_domain () {
1011 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1012 public static void invoke_in_domain_2 () {
1015 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1016 public static void dynamic_methods () {
1017 var m = new DynamicMethod ("dyn_method", typeof (void), new Type [] { typeof (int) }, typeof (object).Module);
1018 var ig = m.GetILGenerator ();
1020 ig.Emit (OpCodes.Ldstr, "FOO");
1021 ig.Emit (OpCodes.Call, typeof (Tests).GetMethod ("dyn_call"));
1022 ig.Emit (OpCodes.Ret);
1024 var del = (Action<int>)m.CreateDelegate (typeof (Action<int>));
1029 public static void dyn_call (string s) {
1032 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1033 public static void ref_emit () {
1034 AssemblyName assemblyName = new AssemblyName ();
1035 assemblyName.Name = "foo";
1037 AssemblyBuilder assembly =
1038 Thread.GetDomain ().DefineDynamicAssembly (
1039 assemblyName, AssemblyBuilderAccess.RunAndSave);
1041 ModuleBuilder module = assembly.DefineDynamicModule ("foo.dll");
1043 TypeBuilder tb = module.DefineType ("foo", TypeAttributes.Public, typeof (object));
1044 MethodBuilder mb = tb.DefineMethod ("ref_emit_method", MethodAttributes.Public|MethodAttributes.Static, CallingConventions.Standard, typeof (void), new Type [] { });
1045 ILGenerator ig = mb.GetILGenerator ();
1046 ig.Emit (OpCodes.Ldstr, "FOO");
1047 ig.Emit (OpCodes.Call, typeof (Tests).GetMethod ("ref_emit_call"));
1048 ig.Emit (OpCodes.Ret);
1050 Type t = tb.CreateType ();
1052 t.GetMethod ("ref_emit_method").Invoke (null, null);
1055 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1056 public static void ref_emit_call (string s) {
1059 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1060 public static void frames_in_native () {
1062 var evt = new ManualResetEvent (false);
1064 object mon = new object ();
1065 ThreadPool.QueueUserWorkItem (delegate {
1066 frames_in_native_2 ();
1072 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1073 static void frames_in_native_2 () {
1074 frames_in_native_3 ();
1077 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1078 static void frames_in_native_3 () {
1081 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1082 public static void string_call (string s) {
1085 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1086 public static void ss_regress_654694 () {
1093 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1094 public static void user () {
1097 Debugger.Log (5, Debugger.IsLogging () ? "A" : "", "B");
1100 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1101 public static void type_load () {
1105 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1106 static void type_load_2 () {
1107 var c1 = new Dictionary<int, int> ();
1109 var c = new TypeLoadClass ();
1111 var c2 = new TypeLoadClass2 ();
1115 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1116 public static void regress () {
1117 regress_2755 (DateTime.Now);
1120 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1121 public static unsafe void regress_2755 (DateTime d) {
1122 int* buffer = stackalloc int [128];
1127 for (int i = 0; i < 128; ++i)
1130 regress_2755_3 (sum);
1133 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1134 public static void regress_2755_2 () {
1137 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1138 public static void regress_2755_3 (int sum) {
1141 static object gc_suspend_field;
1143 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1144 static unsafe void set_gc_suspend_field () {
1145 set_gc_suspend_field_2 ();
1147 int* buffer = stackalloc int [4096];
1150 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1151 static void set_gc_suspend_field_2 () {
1152 gc_suspend_field = new object ();
1155 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1156 static void gc_suspend_1 () {
1159 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1160 public static void gc_suspend_invoke () {
1161 gc_suspend_field = null;
1163 GC.WaitForPendingFinalizers ();
1166 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1167 public static void gc_suspend () {
1168 set_gc_suspend_field ();
1172 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1173 public static void generic_method<T> () where T : class {
1177 class TypeLoadClass {
1180 class TypeLoadClass2 {
1183 public class CrossDomain : MarshalByRefObject
1185 public void invoke () {
1186 Tests.invoke_in_domain ();
1189 public void invoke_2 () {
1190 Tests.invoke_in_domain_2 ();
1193 public int invoke_3 () {
1200 public ProcessStartInfo info;
1203 // Class used for line number info testing, don't change its layout
1204 public class LineNumbers
1206 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1207 public static void ln1 () {
1213 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1214 public static void ln2 () {
1217 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1218 public static void ln3 () {
1219 #pragma warning disable 0219
1221 #pragma warning restore 0219