}
}
-public struct AStruct {
+public struct AStruct : ITest2 {
public int i;
public string s;
public byte k;
public IntPtr j;
public int l;
+/*
+ public AStruct () {
+ i = 0;
+ s = null;
+ k = 0;
+ j = IntPtr.Zero;
+ l = 0;
+ }
+*/
+ public AStruct (int arg) {
+ i = arg;
+ s = null;
+ k = 0;
+ j = IntPtr.Zero;
+ l = 0;
+ }
[MethodImplAttribute (MethodImplOptions.NoInlining)]
public int foo (int val) {
public void invoke_mutate () {
l = 5;
}
+
+ public int invoke_iface () {
+ return i;
+ }
+
+ public override string ToString () {
+ return i.ToString ();
+ }
}
public class GClass<T> {
gc_suspend ();
set_ip ();
step_filters ();
+ local_reflect ();
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 ();
+ if (args.Length > 0 && args [0] == "invoke-abort")
+ new Tests ().invoke_abort ();
new Tests ().evaluate_method ();
return 3;
}
+ public static void local_reflect () {
+ //Breakpoint line below, and reflect someField via ObjectMirror;
+ LocalReflectClass.RunMe ();
+ }
+
public static void breakpoints () {
/* Call these early so it is JITted by the time a breakpoint is placed on it */
bp3 ();
public static void arguments () {
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));
int i = 42;
- arg2 ("FOO", null, "BLA", ref i, new GClass <int> { field = 42 }, new object ());
+ arg2 ("FOO", null, "BLA", ref i, new GClass <int> { field = 42 }, new object (), '\0'.ToString () + "A");
Tests t = new Tests () { field_i = 42, field_s = "S" };
t.arg3 ("BLA");
}
}
[MethodImplAttribute (MethodImplOptions.NoInlining)]
- public static string arg2 (string s, string s3, object o, ref int i, GClass <int> gc, object o2) {
+ public static string arg2 (string s, string s3, object o, ref int i, GClass <int> gc, object o2, string s4) {
return s + (s3 != null ? "" : "") + o + i + gc.field + o2;
}
AStruct[] arr = new AStruct[] {
new AStruct () { i = 1, s = "S1" },
new AStruct () { i = 2, s = "S2" } };
- t.vtypes1 (s, arr);
+ TypedReference typedref = __makeref (s);
+ t.vtypes1 (s, arr, typedref);
vtypes2 (s);
vtypes3 (s);
vtypes4 ();
}
[MethodImplAttribute (MethodImplOptions.NoInlining)]
- public object vtypes1 (AStruct s, AStruct[] arr) {
+ public object vtypes1 (AStruct s, AStruct[] arr, TypedReference typedref) {
if (arr != null)
return this;
else
astruct = new AStruct ();
}
rs = "A";
+ List<int> alist = new List<int> () { 12 };
}
}
}
+ struct TypedRefTest {
+ public int MaxValue;
+ }
+
[MethodImplAttribute (MethodImplOptions.NoInlining)]
public static void type_info () {
Tests t = new Tests () { field_i = 42, field_s = "S", base_field_i = 43, base_field_s = "T", field_enum = AnEnum.B };
int val = 0;
unsafe {
AStruct s = new AStruct () { i = 42, s = "S", k = 43 };
-
- 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);
+ TypedRefTest reftest = new TypedRefTest () { MaxValue = 12 };
+ TypedReference typedref = __makeref (reftest);
+ 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, typedref);
}
}
}
[MethodImplAttribute (MethodImplOptions.NoInlining)]
- 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) {
+ 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, TypedReference typedref) {
return s2 [0] + s3 [0] + s4 [0, 0];
}
public void invoke_single_threaded_2 () {
}
+ [MethodImplAttribute (MethodImplOptions.NoInlining)]
+ public void invoke_abort () {
+ }
+
+ [MethodImplAttribute (MethodImplOptions.NoInlining)]
+ public void invoke_abort_2 () {
+ Thread.Sleep (1000000);
+ }
+
public void invoke_return_void () {
}
CrossDomain o = (CrossDomain)domain.CreateInstanceAndUnwrap (
typeof (CrossDomain).Assembly.FullName, "CrossDomain");
+ domains_print_across (o);
+
domains_2 (o, new CrossDomain ());
o.invoke_2 ();
public static void domains_2 (object o, object o2) {
}
+ [MethodImplAttribute (MethodImplOptions.NoInlining)]
+ public static void domains_print_across (object o) {
+ }
+
[MethodImplAttribute (MethodImplOptions.NoInlining)]
public static void domains_3 () {
}
[MethodImplAttribute (MethodImplOptions.NoInlining)]
public static void set_ip () {
- int i, j;
+ int i = 0, j;
- i = 1;
+ i ++;
+ i ++;
set_ip_1 ();
- i = 5;
+ i ++;
j = 5;
set_ip_2 ();
}
class TypeLoadClass2 {
}
+public class SentinelClass : MarshalByRefObject {
+}
+
public class CrossDomain : MarshalByRefObject
{
+ SentinelClass printMe = new SentinelClass ();
+
public void invoke () {
Tests.invoke_in_domain ();
}
#line 55 "FOO"
}
}
+
+class LocalReflectClass
+{
+ public static void RunMe ()
+ {
+ var reflectMe = new someClass ();
+ reflectMe.someMethod ();
+ }
+
+ class someClass : ContextBoundObject
+ {
+ public object someField;
+
+ public void someMethod ()
+ {
+ }
+ }
+}
+
+