Imported Upstream version 3.8.0

Former-commit-id: 6a76a29bd07d86e57c6c8da45c65ed5447d38a61
This commit is contained in:
Jo Shields
2014-09-04 09:07:35 +01:00
parent a575963da9
commit fe777c5c82
1062 changed files with 12460 additions and 5983 deletions

View File

@@ -81,6 +81,7 @@ public struct AStruct {
public string s;
public byte k;
public IntPtr j;
public int l;
[MethodImplAttribute (MethodImplOptions.NoInlining)]
public int foo (int val) {
@@ -106,6 +107,11 @@ public struct AStruct {
public IntPtr invoke_return_intptr () {
return j;
}
[MethodImplAttribute (MethodImplOptions.NoInlining)]
public void invoke_mutate () {
l = 5;
}
}
public class GClass<T> {
@@ -953,6 +959,11 @@ public class Tests : TestsBase, ITest2
return 42;
}
public void invoke_out (out int foo, out int[] arr) {
foo = 5;
arr = new int [10];
}
[MethodImplAttribute (MethodImplOptions.NoInlining)]
public static void exceptions () {
try {

View File

@@ -2110,6 +2110,21 @@ public class DebuggerTests
Assert.AreEqual ("Exception", ex.Exception.Type.Name);
}
#if NET_4_5
// out argument
m = t.GetMethod ("invoke_out");
var out_task = this_obj.InvokeMethodAsyncWithResult (e.Thread, m, new Value [] { vm.CreateValue (1), vm.CreateValue (null) }, InvokeOptions.ReturnOutArgs);
var out_args = out_task.Result.OutArgs;
AssertValue (5, out_args [0]);
Assert.IsTrue (out_args [1] is ArrayMirror);
Assert.AreEqual (10, (out_args [1] as ArrayMirror).Length);
// without ReturnOutArgs flag
out_task = this_obj.InvokeMethodAsyncWithResult (e.Thread, m, new Value [] { vm.CreateValue (1), vm.CreateValue (null) });
out_args = out_task.Result.OutArgs;
Assert.IsNull (out_args);
#endif
// newobj
m = t.GetMethod (".ctor");
v = t.InvokeMethod (e.Thread, m, null);
@@ -2212,6 +2227,24 @@ public class DebuggerTests
m = t.GetMethod ("invoke_return_int");
v = s.InvokeMethod (e.Thread, m, null);
AssertValue (42, v);
#if NET_4_5
// Invoke a method which changes state
s = frame.GetArgument (1) as StructMirror;
t = s.Type;
m = t.GetMethod ("invoke_mutate");
var task = s.InvokeMethodAsyncWithResult (e.Thread, m, null, InvokeOptions.ReturnOutThis);
var out_this = task.Result.OutThis as StructMirror;
AssertValue (5, out_this ["l"]);
// Without the ReturnOutThis flag
s = frame.GetArgument (1) as StructMirror;
t = s.Type;
m = t.GetMethod ("invoke_mutate");
task = s.InvokeMethodAsyncWithResult (e.Thread, m, null);
out_this = task.Result.OutThis as StructMirror;
Assert.AreEqual (null, out_this);
#endif
}
[Test]