}
+public static class Tests4 {
+ static Tests4 () {
+ }
+}
+
+public class AAttribute : Attribute {
+ public int afield;
+}
+
+public class BAttribute : AAttribute {
+ public int bfield;
+}
+
[DebuggerDisplay ("Tests", Name="FOO", Target=typeof (int))]
[DebuggerTypeProxy (typeof (Tests))]
+[BAttribute (afield = 1, bfield = 2)]
public class Tests2 {
[DebuggerBrowsableAttribute (DebuggerBrowsableState.Collapsed)]
public int field_j;
if (args.Length > 0 && args [0] == "suspend-test")
/* This contains an infinite loop, so execute it conditionally */
suspend ();
+ if (args.Length >0 && args [0] == "unhandled-exception") {
+ unhandled_exception ();
+ return 0;
+ }
+ if (args.Length >0 && args [0] == "unhandled-exception-user") {
+ unhandled_exception_user ();
+ return 0;
+ }
breakpoints ();
single_stepping ();
arguments ();
user ();
type_load ();
regress ();
+ gc_suspend ();
if (args.Length > 0 && args [0] == "domain-test")
/* This takes a lot of time, so execute it conditionally */
domains ();
ref_emit ();
if (args.Length > 0 && args [0] == "frames-in-native")
frames_in_native ();
- if (args.Length >0 && args [0] == "invoke-single-threaded")
+ if (args.Length > 0 && args [0] == "invoke-single-threaded")
new Tests ().invoke_single_threaded ();
return 3;
}
ss6 (b);
} catch {
}
+ ss7 ();
ss_regress_654694 ();
}
[MethodImplAttribute (MethodImplOptions.NoInlining)]
public static void ss6 (bool b) {
if (b) {
- ss7 ();
+ ss6_2 ();
throw new Exception ();
}
}
+ [MethodImplAttribute (MethodImplOptions.NoInlining)]
+ public static void ss6_2 () {
+ }
+
[MethodImplAttribute (MethodImplOptions.NoInlining)]
public static void ss7 () {
+ try {
+ ss7_2 ();
+ ss7_3 ();
+ } catch {
+ }
+ ss7_2 ();
+ }
+
+ [MethodImplAttribute (MethodImplOptions.NoInlining)]
+ public static void ss7_2 () {
+ }
+
+ [MethodImplAttribute (MethodImplOptions.NoInlining)]
+ public static void ss7_3 () {
+ throw new Exception ();
}
[MethodImplAttribute (MethodImplOptions.NoInlining)]
[MethodImplAttribute (MethodImplOptions.NoInlining)]
public static void objects () {
- 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) };
+ 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 };
t.o1 (new Tests2 () { field_j = 43 }, new GClass <int> { field = 42 }, new GClass <string> { field = "FOO" });
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 });
}
locals6 ();
}
+ [MethodImplAttribute (MethodImplOptions.NoInlining)]
+ static void locals11 (double a, ref double b) {
+ }
+
[MethodImplAttribute (MethodImplOptions.NoInlining)]
public static void locals1 (string[] args) {
long foo = 42;
+ double ri = 1;
+ locals11 (b: ref ri, a: ri);
+
for (int j = 0; j < 10; ++j) {
foo ++;
}
}
[MethodImplAttribute (MethodImplOptions.NoInlining)]
+ [StateMachine (typeof (int))]
public static void locals2<T> (string[] args, int arg, T t, ref string rs) {
long i = 42;
string s = "AB";
}
}
+ [MethodImplAttribute (MethodImplOptions.NoInlining)]
+ public static void unhandled_exception () {
+ ThreadPool.QueueUserWorkItem (delegate {
+ throw new InvalidOperationException ();
+ });
+ Thread.Sleep (10000);
+ }
+
+ [MethodImplAttribute (MethodImplOptions.NoInlining)]
+ public static void unhandled_exception_user () {
+#if NET_4_5
+ System.Threading.Tasks.Task.Factory.StartNew (() => {
+ Throw ();
+ });
+ Thread.Sleep (10000);
+#endif
+ }
+
+ [MethodImplAttribute (MethodImplOptions.NoInlining)]
+ public static void Throw () {
+ throw new Exception ();
+ }
+
internal static Delegate create_filter_delegate (Delegate dlg, MethodInfo filter_method)
{
if (dlg == null)
CrossDomain o = (CrossDomain)domain.CreateInstanceAndUnwrap (
typeof (CrossDomain).Assembly.FullName, "CrossDomain");
+ domains_2 (o, new CrossDomain ());
+
o.invoke_2 ();
o.invoke ();
AppDomain.Unload (domain);
- domains_2 ();
+ domains_3 ();
}
[MethodImplAttribute (MethodImplOptions.NoInlining)]
- public static void domains_2 () {
+ public static void domains_2 (object o, object o2) {
+ }
+
+ [MethodImplAttribute (MethodImplOptions.NoInlining)]
+ public static void domains_3 () {
}
[MethodImplAttribute (MethodImplOptions.NoInlining)]
[MethodImplAttribute (MethodImplOptions.NoInlining)]
public static void frames_in_native () {
Thread.Sleep (500);
+ object mon = new object ();
+ ThreadPool.QueueUserWorkItem (delegate {
+ frames_in_native_2 ();
+ lock (mon) {
+ Monitor.Pulse (mon);
+ }
+ });
+ lock (mon) {
+ Monitor.Wait (mon);
+ }
+ }
+
+ [MethodImplAttribute (MethodImplOptions.NoInlining)]
+ static void frames_in_native_2 () {
+ frames_in_native_3 ();
+ }
+
+ [MethodImplAttribute (MethodImplOptions.NoInlining)]
+ static void frames_in_native_3 () {
}
[MethodImplAttribute (MethodImplOptions.NoInlining)]
[MethodImplAttribute (MethodImplOptions.NoInlining)]
public static void regress_2755_3 (int sum) {
}
+
+ static object gc_suspend_field;
+
+ [MethodImplAttribute (MethodImplOptions.NoInlining)]
+ static unsafe void set_gc_suspend_field () {
+ set_gc_suspend_field_2 ();
+ // Clear stack
+ int* buffer = stackalloc int [4096];
+ }
+
+ [MethodImplAttribute (MethodImplOptions.NoInlining)]
+ static void set_gc_suspend_field_2 () {
+ gc_suspend_field = new object ();
+ }
+
+ [MethodImplAttribute (MethodImplOptions.NoInlining)]
+ static void gc_suspend_1 () {
+ }
+
+ [MethodImplAttribute (MethodImplOptions.NoInlining)]
+ public static void gc_suspend_invoke () {
+ gc_suspend_field = null;
+ GC.Collect ();
+ GC.WaitForPendingFinalizers ();
+ }
+
+ [MethodImplAttribute (MethodImplOptions.NoInlining)]
+ public static void gc_suspend () {
+ set_gc_suspend_field ();
+ gc_suspend_1 ();
+ }
}
class TypeLoadClass {
public void invoke_2 () {
Tests.invoke_in_domain_2 ();
}
+
+ public int invoke_3 () {
+ return 42;
+ }
}
public class Foo
{
[MethodImplAttribute (MethodImplOptions.NoInlining)]
public static void ln1 () {
+ // Column 3
ln2 ();
ln3 ();
}