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;
196 public KeyValuePair<int, object> boxed_struct_field;
198 public static int tls_i;
199 public static bool is_attached = Debugger.IsAttached;
201 #pragma warning restore 0414
203 public class NestedClass {
206 public int IntProperty {
215 public int ReadOnlyProperty {
221 public int this [int index] {
227 public static void wait_one ()
229 ManualResetEvent evt = new ManualResetEvent (false);
233 public static int Main (String[] args) {
236 if (args.Length > 0 && args [0] == "suspend-test")
237 /* This contains an infinite loop, so execute it conditionally */
239 if (args.Length >0 && args [0] == "unhandled-exception") {
240 unhandled_exception ();
243 if (args.Length >0 && args [0] == "unhandled-exception-endinvoke") {
244 unhandled_exception_endinvoke ();
247 if (args.Length >0 && args [0] == "unhandled-exception-user") {
248 unhandled_exception_user ();
251 if (args.Length >0 && args [0] == "wait-one") {
274 if (args.Length > 0 && args [0] == "domain-test")
275 /* This takes a lot of time, so execute it conditionally */
277 if (args.Length > 0 && args [0] == "ref-emit-test")
279 if (args.Length > 0 && args [0] == "frames-in-native")
281 if (args.Length > 0 && args [0] == "invoke-single-threaded")
282 new Tests ().invoke_single_threaded ();
286 public static void breakpoints () {
287 /* Call these early so it is JITted by the time a breakpoint is placed on it */
299 bp6<string> (new GClass <int> ());
304 [MethodImplAttribute (MethodImplOptions.NoInlining)]
305 public static void bp1 () {
308 [MethodImplAttribute (MethodImplOptions.NoInlining)]
309 public static void bp2 () {
312 [MethodImplAttribute (MethodImplOptions.NoInlining)]
313 public static void bp3 () {
316 [MethodImplAttribute (MethodImplOptions.NoInlining)]
317 public static void bp4 () {
320 [MethodImplAttribute (MethodImplOptions.NoInlining)]
321 public static void bp5 () {
324 [MethodImplAttribute (MethodImplOptions.NoInlining)]
325 public static void bp6<T> (GClass<int> gc) {
329 [MethodImplAttribute (MethodImplOptions.NoInlining)]
330 public static void bp7<T> () {
333 [MethodImplAttribute (MethodImplOptions.NoInlining)]
334 public static void single_stepping () {
341 ss5 (new int [] { 1, 2, 3 }, new Func<int, bool> (is_even));
347 ss_regress_654694 ();
350 [MethodImplAttribute (MethodImplOptions.NoInlining)]
351 public static void ss1 () {
354 [MethodImplAttribute (MethodImplOptions.NoInlining)]
355 public static void ss2 () {
358 [MethodImplAttribute (MethodImplOptions.NoInlining)]
359 public static int ss3 () {
362 for (int i = 0; i < 10; ++i)
368 [MethodImplAttribute (MethodImplOptions.NoInlining)]
369 public static void ss3_2 () {
373 [MethodImplAttribute (MethodImplOptions.NoInlining)]
374 public static void ss3_2_2 () {
377 [MethodImplAttribute (MethodImplOptions.NoInlining)]
378 public static int ss4 () {
384 [MethodImplAttribute (MethodImplOptions.NoInlining)]
385 public static void ss5 (int[] arr, Func<int, bool> selector) {
386 // Call into linq which calls back into this assembly
387 arr.Count (selector);
390 [MethodImplAttribute (MethodImplOptions.NoInlining)]
391 public static void ss6 (bool b) {
394 throw new Exception ();
398 [MethodImplAttribute (MethodImplOptions.NoInlining)]
399 public static void ss6_2 () {
402 [MethodImplAttribute (MethodImplOptions.NoInlining)]
403 public static void ss7 () {
412 [MethodImplAttribute (MethodImplOptions.NoInlining)]
413 public static void ss7_2 () {
416 [MethodImplAttribute (MethodImplOptions.NoInlining)]
417 public static void ss7_3 () {
418 throw new Exception ();
421 [MethodImplAttribute (MethodImplOptions.NoInlining)]
422 public static bool is_even (int i) {
428 Console.WriteLine ("HIT!");
434 [MethodImplAttribute (MethodImplOptions.NoInlining)]
435 public static void arguments () {
436 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));
438 arg2 ("FOO", null, "BLA", ref i, new GClass <int> { field = 42 }, new object ());
439 Tests t = new Tests () { field_i = 42, field_s = "S" };
443 [MethodImplAttribute (MethodImplOptions.NoInlining)]
444 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) {
445 return (int)(sb + b + (bl ? 0 : 1) + s + us + (int)c + i + ui + l + (long)ul + f + d + (int)ip + (int)uip);
448 [MethodImplAttribute (MethodImplOptions.NoInlining)]
449 public static string arg2 (string s, string s3, object o, ref int i, GClass <int> gc, object o2) {
450 return s + (s3 != null ? "" : "") + o + i + gc.field + o2;
453 [MethodImplAttribute (MethodImplOptions.NoInlining)]
454 public object arg3 (string s) {
455 return s + s + s + s + this;
458 [MethodImplAttribute (MethodImplOptions.NoInlining)]
459 public static void objects () {
460 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 };
461 t.o1 (new Tests2 () { field_j = 43 }, new GClass <int> { field = 42 }, new GClass <string> { field = "FOO" });
462 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 });
465 [MethodImplAttribute (MethodImplOptions.NoInlining)]
466 public object o1 (Tests2 t, GClass <int> gc1, GClass <string> gc2) {
467 if (t == null || gc1 == null || gc2 == null)
473 [MethodImplAttribute (MethodImplOptions.NoInlining)]
474 public static string o2 (string[] s2, int[] s3, int[,] s4, int[,] s5, IList<int> s6) {
475 return s2 [0] + s3 [0] + s4 [0, 0] + s6 [0];
478 [MethodImplAttribute (MethodImplOptions.NoInlining)]
479 public static void objrefs () {
480 Tests t = new Tests () {};
488 [MethodImplAttribute (MethodImplOptions.NoInlining)]
489 public static void set_child (Tests t) {
490 t.child = new Tests ();
493 [MethodImplAttribute (MethodImplOptions.NoInlining)]
494 public void objrefs1 () {
497 [MethodImplAttribute (MethodImplOptions.NoInlining)]
498 public static void objrefs2 () {
501 public static void vtypes () {
502 Tests t = new Tests () { field_struct = new AStruct () { i = 42, s = "S", k = 43 }, generic_field_struct = new GStruct<int> () { i = 42 }, field_boxed_struct = new AStruct () { i = 42 }, boxed_struct_field = new KeyValuePair<int, object> (1, (long)42 ) };
503 AStruct s = new AStruct { i = 44, s = "T", k = 45 };
504 AStruct[] arr = new AStruct[] {
505 new AStruct () { i = 1, s = "S1" },
506 new AStruct () { i = 2, s = "S2" } };
512 [MethodImplAttribute (MethodImplOptions.NoInlining)]
513 public object vtypes1 (AStruct s, AStruct[] arr) {
520 [MethodImplAttribute (MethodImplOptions.NoInlining)]
521 public static void vtypes2 (AStruct s) {
525 [MethodImplAttribute (MethodImplOptions.NoInlining)]
526 public static void vtypes3 (AStruct s) {
527 AStruct.static_foo (5);
530 [MethodImplAttribute (MethodImplOptions.NoInlining)]
531 public static void locals () {
534 locals2<string> (null, 5, "ABC", ref s);
540 [MethodImplAttribute (MethodImplOptions.NoInlining)]
541 static void locals11 (double a, ref double b) {
544 [MethodImplAttribute (MethodImplOptions.NoInlining)]
545 public static void locals1 (string[] args) {
549 locals11 (b: ref ri, a: ri);
551 for (int j = 0; j < 10; ++j) {
556 [MethodImplAttribute (MethodImplOptions.NoInlining)]
557 [StateMachine (typeof (int))]
558 public static void locals2<T> (string[] args, int arg, T t, ref string rs) {
562 for (int j = 0; j < 10; ++j) {
571 [MethodImplAttribute (MethodImplOptions.NoInlining)]
572 public static void locals3 () {
592 [MethodImplAttribute (MethodImplOptions.NoInlining)]
593 public static void locals4 () {
596 [MethodImplAttribute (MethodImplOptions.NoInlining)]
597 public static void locals5 () {
600 [MethodImplAttribute (MethodImplOptions.NoInlining)]
601 public static void locals6 () {
604 for (i = 0; i < 10; ++i)
607 for (i = 0; i < 10; ++i)
617 [MethodImplAttribute (MethodImplOptions.NoInlining)]
618 public static void locals6_1 () {
621 [MethodImplAttribute (MethodImplOptions.NoInlining)]
622 public static void locals6_2 (int arg) {
625 [MethodImplAttribute (MethodImplOptions.NoInlining)]
626 public static void locals6_3 () {
627 // Clobber all registers
628 int sum = 0, i, j, k, l, m;
629 for (i = 0; i < 100; ++i)
631 for (j = 0; j < 100; ++j)
633 for (k = 0; k < 100; ++k)
635 for (l = 0; l < 100; ++l)
637 for (m = 0; m < 100; ++m)
641 [MethodImplAttribute (MethodImplOptions.NoInlining)]
642 public static void locals6_4 (int arg) {
645 [MethodImplAttribute (MethodImplOptions.NoInlining)]
646 public static void locals6_5 () {
649 [MethodImplAttribute (MethodImplOptions.NoInlining)]
650 public static void locals6_6 (int arg) {
653 [MethodImplAttribute (MethodImplOptions.NoInlining)]
654 public static void locals7<T> (T arg) {
659 [MethodImplAttribute (MethodImplOptions.NoInlining)]
660 public static void line_numbers () {
664 [MethodImplAttribute (MethodImplOptions.NoInlining)]
665 public static void suspend () {
673 [MethodImplAttribute (MethodImplOptions.NoInlining)]
674 public static void type_info () {
675 Tests t = new Tests () { field_i = 42, field_s = "S", base_field_i = 43, base_field_s = "T", field_enum = AnEnum.B };
676 t.ti1 (new Tests2 () { field_j = 43 }, new GClass <int> { field = 42 }, new GClass <string> { field = "FOO" });
679 AStruct s = new AStruct () { i = 42, s = "S", k = 43 };
681 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);
685 [MethodImplAttribute (MethodImplOptions.NoInlining)]
686 public object ti1 (Tests2 t, GClass <int> gc1, GClass <string> gc2) {
687 if (t == null || gc1 == null || gc2 == null)
693 [MethodImplAttribute (MethodImplOptions.NoInlining)]
694 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) {
695 return s2 [0] + s3 [0] + s4 [0, 0];
698 [MethodImplAttribute (MethodImplOptions.NoInlining)]
699 public static void assembly_load () {
703 [MethodImplAttribute (MethodImplOptions.NoInlining)]
704 public static void assembly_load_2 () {
705 // This will load System.dll while holding the loader lock
709 [MethodImplAttribute (MethodImplOptions.NoInlining)]
710 public static void invoke () {
711 new Tests ().invoke1 (new Tests2 (), new AStruct () { i = 42, j = (IntPtr)43 }, new GStruct<int> { j = 42 });
712 new Tests ().invoke_ex ();
715 [MethodImplAttribute (MethodImplOptions.NoInlining)]
716 public void invoke1 (Tests2 t, AStruct s, GStruct<int> g) {
720 [MethodImplAttribute (MethodImplOptions.NoInlining)]
721 public void invoke2 () {
724 [MethodImplAttribute (MethodImplOptions.NoInlining)]
725 public void invoke_ex () {
729 [MethodImplAttribute (MethodImplOptions.NoInlining)]
730 public void invoke_ex_inner () {
732 throw new Exception ();
739 [MethodImplAttribute (MethodImplOptions.NoInlining)]
740 public void invoke_single_threaded () {
741 // Spawn a thread incrementing a counter
742 bool finished = false;
744 new Thread (delegate () {
751 invoke_single_threaded_2 ();
756 [MethodImplAttribute (MethodImplOptions.NoInlining)]
757 public void invoke_single_threaded_2 () {
760 public void invoke_return_void () {
763 public string invoke_return_ref () {
767 public object invoke_return_null () {
771 public int invoke_return_primitive () {
775 public int? invoke_return_nullable () {
779 public int? invoke_return_nullable_null () {
783 public void invoke_type_load () {
790 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) {
791 return ub + sb + ss + us + i + ui + l + (long)ul + (int)c + (b ? 1 : 0) + (int)f + (int)d;
794 public int invoke_pass_primitive2 (bool b) {
798 public string invoke_pass_ref (string s) {
802 public static string invoke_static_pass_ref (string s) {
806 public static void invoke_static_return_void () {
809 public static void invoke_throws () {
810 throw new Exception ();
813 [MethodImplAttribute (MethodImplOptions.NoInlining)]
814 public static void exceptions () {
816 throw new OverflowException ();
817 } catch (Exception) {
820 throw new OverflowException ();
821 } catch (Exception) {
824 throw new ArgumentException ();
825 } catch (Exception) {
828 throw new OverflowException ();
829 } catch (Exception) {
835 } catch (Exception) {
840 } catch (Exception) {
844 [MethodImplAttribute (MethodImplOptions.NoInlining)]
845 public static void unhandled_exception () {
846 ThreadPool.QueueUserWorkItem (delegate {
847 throw new InvalidOperationException ();
849 Thread.Sleep (10000);
852 [MethodImplAttribute (MethodImplOptions.NoInlining)]
853 public static void unhandled_exception_endinvoke_2 () {
856 [MethodImplAttribute (MethodImplOptions.NoInlining)]
857 public static void unhandled_exception_endinvoke () {
858 Action action = new Action (() =>
860 throw new Exception ("thrown");
862 action.BeginInvoke ((ar) => {
864 action.EndInvoke (ar);
865 } catch (Exception ex) {
866 //Console.WriteLine (ex);
870 unhandled_exception_endinvoke_2 ();
873 [MethodImplAttribute (MethodImplOptions.NoInlining)]
874 public static void unhandled_exception_user () {
876 System.Threading.Tasks.Task.Factory.StartNew (() => {
879 Thread.Sleep (10000);
883 [MethodImplAttribute (MethodImplOptions.NoInlining)]
884 public static void Throw () {
885 throw new Exception ();
888 internal static Delegate create_filter_delegate (Delegate dlg, MethodInfo filter_method)
891 throw new ArgumentNullException ();
892 if (dlg.Target != null)
893 throw new ArgumentException ();
894 if (dlg.Method == null)
895 throw new ArgumentException ();
897 var ret_type = dlg.Method.ReturnType;
898 var param_types = dlg.Method.GetParameters ().Select (x => x.ParameterType).ToArray ();
900 var dynamic = new DynamicMethod (Guid.NewGuid ().ToString (), ret_type, param_types, typeof (object), true);
901 var ig = dynamic.GetILGenerator ();
903 LocalBuilder retval = null;
904 if (ret_type != typeof (void))
905 retval = ig.DeclareLocal (ret_type);
907 var label = ig.BeginExceptionBlock ();
909 for (int i = 0; i < param_types.Length; i++)
910 ig.Emit (OpCodes.Ldarg, i);
911 ig.Emit (OpCodes.Call, dlg.Method);
914 ig.Emit (OpCodes.Stloc, retval);
916 ig.Emit (OpCodes.Leave, label);
918 ig.BeginExceptFilterBlock ();
920 ig.Emit (OpCodes.Call, filter_method);
922 ig.BeginCatchBlock (null);
924 ig.Emit (OpCodes.Pop);
926 ig.EndExceptionBlock ();
929 ig.Emit (OpCodes.Ldloc, retval);
931 ig.Emit (OpCodes.Ret);
933 return dynamic.CreateDelegate (dlg.GetType ());
936 [MethodImplAttribute (MethodImplOptions.NoInlining)]
937 static void exception_filter_method () {
938 throw new InvalidOperationException ();
941 [MethodImplAttribute (MethodImplOptions.NoInlining)]
942 static int exception_filter_filter (Exception exc) {
946 [MethodImplAttribute (MethodImplOptions.NoInlining)]
947 public static void exception_filter () {
948 var method = typeof (Tests).GetMethod (
949 "exception_filter_method", BindingFlags.NonPublic | BindingFlags.Static);
950 var filter_method = typeof (Tests).GetMethod (
951 "exception_filter_filter", BindingFlags.NonPublic | BindingFlags.Static);
953 var dlg = Delegate.CreateDelegate (typeof (Action), method);
955 var wrapper = (Action) create_filter_delegate (dlg, filter_method);
960 [MethodImplAttribute (MethodImplOptions.NoInlining)]
961 public static bool return_true () {
965 [MethodImplAttribute (MethodImplOptions.NoInlining)]
966 public static void exceptions2 () {
968 throw new Exception ();
969 Console.WriteLine ();
972 [MethodImplAttribute (MethodImplOptions.NoInlining)]
973 public static void threads () {
974 Thread t = new Thread (delegate () {});
980 [MethodImplAttribute (MethodImplOptions.NoInlining)]
981 public static void domains () {
982 AppDomain domain = AppDomain.CreateDomain ("domain");
984 CrossDomain o = (CrossDomain)domain.CreateInstanceAndUnwrap (
985 typeof (CrossDomain).Assembly.FullName, "CrossDomain");
987 domains_2 (o, new CrossDomain ());
995 AppDomain.Unload (domain);
1000 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1001 public static void domains_2 (object o, object o2) {
1004 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1005 public static void domains_3 () {
1008 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1009 public static void invoke_in_domain () {
1012 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1013 public static void invoke_in_domain_2 () {
1016 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1017 public static void dynamic_methods () {
1018 var m = new DynamicMethod ("dyn_method", typeof (void), new Type [] { typeof (int) }, typeof (object).Module);
1019 var ig = m.GetILGenerator ();
1021 ig.Emit (OpCodes.Ldstr, "FOO");
1022 ig.Emit (OpCodes.Call, typeof (Tests).GetMethod ("dyn_call"));
1023 ig.Emit (OpCodes.Ret);
1025 var del = (Action<int>)m.CreateDelegate (typeof (Action<int>));
1030 public static void dyn_call (string s) {
1033 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1034 public static void ref_emit () {
1035 AssemblyName assemblyName = new AssemblyName ();
1036 assemblyName.Name = "foo";
1038 AssemblyBuilder assembly =
1039 Thread.GetDomain ().DefineDynamicAssembly (
1040 assemblyName, AssemblyBuilderAccess.RunAndSave);
1042 ModuleBuilder module = assembly.DefineDynamicModule ("foo.dll");
1044 TypeBuilder tb = module.DefineType ("foo", TypeAttributes.Public, typeof (object));
1045 MethodBuilder mb = tb.DefineMethod ("ref_emit_method", MethodAttributes.Public|MethodAttributes.Static, CallingConventions.Standard, typeof (void), new Type [] { });
1046 ILGenerator ig = mb.GetILGenerator ();
1047 ig.Emit (OpCodes.Ldstr, "FOO");
1048 ig.Emit (OpCodes.Call, typeof (Tests).GetMethod ("ref_emit_call"));
1049 ig.Emit (OpCodes.Ret);
1051 Type t = tb.CreateType ();
1053 t.GetMethod ("ref_emit_method").Invoke (null, null);
1056 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1057 public static void ref_emit_call (string s) {
1060 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1061 public static void frames_in_native () {
1063 var evt = new ManualResetEvent (false);
1065 object mon = new object ();
1066 ThreadPool.QueueUserWorkItem (delegate {
1067 frames_in_native_2 ();
1073 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1074 static void frames_in_native_2 () {
1075 frames_in_native_3 ();
1078 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1079 static void frames_in_native_3 () {
1082 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1083 public static void string_call (string s) {
1086 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1087 public static void ss_regress_654694 () {
1094 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1095 public static void user () {
1098 Debugger.Log (5, Debugger.IsLogging () ? "A" : "", "B");
1101 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1102 public static void type_load () {
1106 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1107 static void type_load_2 () {
1108 var c1 = new Dictionary<int, int> ();
1110 var c = new TypeLoadClass ();
1112 var c2 = new TypeLoadClass2 ();
1116 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1117 public static void regress () {
1118 regress_2755 (DateTime.Now);
1121 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1122 public static unsafe void regress_2755 (DateTime d) {
1123 int* buffer = stackalloc int [128];
1128 for (int i = 0; i < 128; ++i)
1131 regress_2755_3 (sum);
1134 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1135 public static void regress_2755_2 () {
1138 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1139 public static void regress_2755_3 (int sum) {
1142 static object gc_suspend_field;
1144 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1145 static unsafe void set_gc_suspend_field () {
1146 set_gc_suspend_field_2 ();
1148 int* buffer = stackalloc int [4096];
1151 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1152 static void set_gc_suspend_field_2 () {
1153 gc_suspend_field = new object ();
1156 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1157 static void gc_suspend_1 () {
1160 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1161 public static void gc_suspend_invoke () {
1162 gc_suspend_field = null;
1164 GC.WaitForPendingFinalizers ();
1167 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1168 public static void gc_suspend () {
1169 set_gc_suspend_field ();
1173 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1174 public static void generic_method<T> () where T : class {
1178 class TypeLoadClass {
1181 class TypeLoadClass2 {
1184 public class CrossDomain : MarshalByRefObject
1186 public void invoke () {
1187 Tests.invoke_in_domain ();
1190 public void invoke_2 () {
1191 Tests.invoke_in_domain_2 ();
1194 public int invoke_3 () {
1201 public ProcessStartInfo info;
1204 // Class used for line number info testing, don't change its layout
1205 public class LineNumbers
1207 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1208 public static void ln1 () {
1214 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1215 public static void ln2 () {
1218 [MethodImplAttribute (MethodImplOptions.NoInlining)]
1219 public static void ln3 () {
1220 #pragma warning disable 0219
1222 #pragma warning restore 0219