diff --git a/TestCases/CLRBindingTest.cs b/TestCases/CLRBindingTest.cs index ffdd3d76..2247f928 100644 --- a/TestCases/CLRBindingTest.cs +++ b/TestCases/CLRBindingTest.cs @@ -143,42 +143,36 @@ public static void CLRBindingTestEnd() ILRuntimeTest.TestBase.TestSession.LastSession.Appdomain.AllowUnboundCLRMethod = true; } - [ILRuntimeTest.ILRuntimeTest(ExpectException = typeof(ILRuntimeException))] public static void CLRBindingTestMissing01() { ILRuntimeTest.TestFramework.TestCLRBinding binding = new ILRuntimeTest.TestFramework.TestCLRBinding(); binding.MissingMethod(); } - [ILRuntimeTest.ILRuntimeTest(ExpectException = typeof(ILRuntimeException))] public static void CLRBindingTestMissing02() { ILRuntimeTest.TestFramework.TestCLRBinding binding = new ILRuntimeTest.TestFramework.TestCLRBinding(); binding.MissingMethodGeneric(null); } - [ILRuntimeTest.ILRuntimeTest(ExpectException = typeof(ILRuntimeException))] public static void CLRBindingTestMissing03() { ILRuntimeTest.TestFramework.TestCLRBinding binding = new ILRuntimeTest.TestFramework.TestCLRBinding(); binding.missingField = 123; } - [ILRuntimeTest.ILRuntimeTest(ExpectException = typeof(ILRuntimeException))] public static void CLRBindingTestMissing04() { ILRuntimeTest.TestFramework.TestCLRBinding binding = new ILRuntimeTest.TestFramework.TestCLRBinding(); binding.Emit(null); } - [ILRuntimeTest.ILRuntimeTest(ExpectException = typeof(ILRuntimeException))] public static void CLRBindingTestMissing05() { ILRuntimeTest.TestFramework.TestCLRBinding binding = new ILRuntimeTest.TestFramework.TestCLRBinding(); binding.MissingMethodGeneric(null); } - [ILRuntimeTest.ILRuntimeTest(ExpectException = typeof(ILRuntimeException))] public static void CLRBindingTestMissing08() { MissingType mt = new MissingType(); diff --git a/TestCases/RegisterVMTest.cs b/TestCases/RegisterVMTest.cs new file mode 100644 index 00000000..835e444d --- /dev/null +++ b/TestCases/RegisterVMTest.cs @@ -0,0 +1,50 @@ +using ILRuntimeTest; +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Text; +using static System.Runtime.CompilerServices.RuntimeHelpers; + +namespace TestCases +{ + public class RegisterVMTest + { + public static void RegisterVMTest01() + { + InlineTest test = new InlineTest(); + test.DoTest(true); + } + + class InlineTest + { + int a; + + int A + { + get + { + if (a > 10) + return 10; + + if (a < 2) + return 2; + + return a; + } + } + + public void DoTest(bool arg) + { + if (arg) + { + a = 8; + var tmp = A; + if (tmp != 8) + throw new Exception(); + Console.WriteLine(tmp); + } + } + } + } +}