}
}
+public struct NestedStruct {
+ NestedInner nested1, nested2;
+}
+
+public struct NestedInner {
+}
+
interface ITest
{
void Foo ();
}
}
-public class Tests : TestsBase
+public interface ITest2
+{
+ int invoke_iface ();
+}
+
+public class Tests : TestsBase, ITest2
{
#pragma warning disable 0414
int field_i;
public AStruct field_struct;
public object field_boxed_struct;
public GStruct<int> generic_field_struct;
+ public KeyValuePair<int, object> boxed_struct_field;
[ThreadStatic]
public static int tls_i;
public static bool is_attached = Debugger.IsAttached;
+ public NestedStruct nested_struct;
#pragma warning restore 0414
}
}
+ public static void wait_one ()
+ {
+ ManualResetEvent evt = new ManualResetEvent (false);
+ evt.WaitOne ();
+ }
+
public static int Main (String[] args) {
tls_i = 42;
unhandled_exception_user ();
return 0;
}
+ if (args.Length >0 && args [0] == "wait-one") {
+ wait_one ();
+ return 0;
+ }
breakpoints ();
single_stepping ();
arguments ();
type_load ();
regress ();
gc_suspend ();
+ set_ip ();
if (args.Length > 0 && args [0] == "domain-test")
/* This takes a lot of time, so execute it conditionally */
domains ();
frames_in_native ();
if (args.Length > 0 && args [0] == "invoke-single-threaded")
new Tests ().invoke_single_threaded ();
+ new Tests ().evaluate_method ();
return 3;
}
} catch {
}
ss7 ();
+ ss_nested ();
ss_regress_654694 ();
+ ss_step_through ();
+ ss_recursive (1);
+ ss_fp_clobber ();
}
[MethodImplAttribute (MethodImplOptions.NoInlining)]
throw new Exception ();
}
+ [MethodImplAttribute (MethodImplOptions.NoInlining)]
+ public static void ss_nested () {
+ ss_nested_1 (ss_nested_2 ());
+ ss_nested_1 (ss_nested_2 ());
+ ss_nested_3 ();
+ }
+
+ [MethodImplAttribute (MethodImplOptions.NoInlining)]
+ public static void ss_nested_1 (int i) {
+ }
+
+ [MethodImplAttribute (MethodImplOptions.NoInlining)]
+ public static int ss_nested_2 () {
+ return 0;
+ }
+
+ [MethodImplAttribute (MethodImplOptions.NoInlining)]
+ public static void ss_nested_3 () {
+ }
+
+ [MethodImplAttribute (MethodImplOptions.NoInlining)]
+ public static void ss_step_through () {
+ step_through_1 ();
+ StepThroughClass.step_through_2 ();
+ step_through_3 ();
+ }
+
+ [DebuggerStepThrough]
+ [MethodImplAttribute (MethodImplOptions.NoInlining)]
+ public static void step_through_1 () {
+ }
+
+ [DebuggerStepThrough]
+ class StepThroughClass {
+ [MethodImplAttribute (MethodImplOptions.NoInlining)]
+ public static void step_through_2 () {
+ }
+ }
+
+ [DebuggerStepThrough]
+ [MethodImplAttribute (MethodImplOptions.NoInlining)]
+ public static void step_through_3 () {
+ }
+
+ [MethodImplAttribute (MethodImplOptions.NoInlining)]
+ public static void ss_recursive (int n) {
+ if (n == 10)
+ return;
+ ss_recursive (n + 1);
+ }
+
+ [MethodImplAttribute (MethodImplOptions.NoInlining)]
+ public static void ss_fp_clobber () {
+ double v = ss_fp_clobber_1 (5.0);
+ ss_fp_clobber_2 (v);
+ }
+
+ [MethodImplAttribute (MethodImplOptions.NoInlining)]
+ public static double ss_fp_clobber_1 (double d) {
+ return d + 2.0;
+ }
+
+ [MethodImplAttribute (MethodImplOptions.NoInlining)]
+ public static void ss_fp_clobber_2 (double d) {
+ }
+
[MethodImplAttribute (MethodImplOptions.NoInlining)]
public static bool is_even (int i) {
return i % 2 == 0;
}
public static void vtypes () {
- 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 }};
+ 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 ) };
AStruct s = new AStruct { i = 44, s = "T", k = 45 };
AStruct[] arr = new AStruct[] {
new AStruct () { i = 1, s = "S1" },
[MethodImplAttribute (MethodImplOptions.NoInlining)]
public static void locals () {
string s = null;
+ var astruct = new AStruct () { i = 42 };
locals1 (null);
- locals2<string> (null, 5, "ABC", ref s);
+ locals2<string> (null, 5, "ABC", ref s, ref astruct);
locals3 ();
locals6 ();
+ locals7<int> (22);
}
[MethodImplAttribute (MethodImplOptions.NoInlining)]
}
[MethodImplAttribute (MethodImplOptions.NoInlining)]
+#if NET_4_5
[StateMachine (typeof (int))]
- public static void locals2<T> (string[] args, int arg, T t, ref string rs) {
+#endif
+ public static void locals2<T> (string[] args, int arg, T t, ref string rs, ref AStruct astruct) {
long i = 42;
string s = "AB";
i ++;
if (t != null)
i ++;
+ astruct = new AStruct ();
}
rs = "A";
}
+
[MethodImplAttribute (MethodImplOptions.NoInlining)]
public static void locals3 () {
string s = "B";
public static void locals6_6 (int arg) {
}
+ [MethodImplAttribute (MethodImplOptions.NoInlining)]
+ public static void locals7<T> (T arg) {
+ T t = arg;
+ T t2 = t;
+ }
+
[MethodImplAttribute (MethodImplOptions.NoInlining)]
public static void line_numbers () {
LineNumbers.ln1 ();
throw new Exception ();
}
+ public int invoke_iface () {
+ return 42;
+ }
+
[MethodImplAttribute (MethodImplOptions.NoInlining)]
public static void exceptions () {
try {
throw new OverflowException ();
} catch (Exception) {
}
+ // no subclasses
+ try {
+ throw new OverflowException ();
+ } catch (Exception) {
+ }
+ try {
+ throw new Exception ();
+ } catch (Exception) {
+ }
object o = null;
try {
[MethodImplAttribute (MethodImplOptions.NoInlining)]
public static void frames_in_native () {
Thread.Sleep (500);
+ var evt = new ManualResetEvent (false);
+
object mon = new object ();
ThreadPool.QueueUserWorkItem (delegate {
frames_in_native_2 ();
- lock (mon) {
- Monitor.Pulse (mon);
- }
+ evt.Set ();
});
- lock (mon) {
- Monitor.Wait (mon);
- }
+ evt.WaitOne ();
}
[MethodImplAttribute (MethodImplOptions.NoInlining)]
set_gc_suspend_field ();
gc_suspend_1 ();
}
+
+ [MethodImplAttribute (MethodImplOptions.NoInlining)]
+ public static void generic_method<T> () where T : class {
+ }
+
+ [MethodImplAttribute (MethodImplOptions.NoInlining)]
+ public void evaluate_method_2 () {
+ }
+
+ [MethodImplAttribute (MethodImplOptions.NoInlining)]
+ public void evaluate_method () {
+ field_i = 42;
+ evaluate_method_2 ();
+ }
+
+ [MethodImplAttribute (MethodImplOptions.NoInlining)]
+ static void set_ip_1 () {
+ }
+
+ [MethodImplAttribute (MethodImplOptions.NoInlining)]
+ static void set_ip_2 () {
+ }
+
+ [MethodImplAttribute (MethodImplOptions.NoInlining)]
+ public static void set_ip () {
+ int i, j;
+
+ i = 1;
+ set_ip_1 ();
+ i = 5;
+ j = 5;
+ set_ip_2 ();
+ }
}
class TypeLoadClass {