diff --git a/TestCases/LightTester2.cs b/TestCases/LightTester2.cs index ea27bbb2..9eb3c6f2 100644 --- a/TestCases/LightTester2.cs +++ b/TestCases/LightTester2.cs @@ -183,9 +183,9 @@ public static void UnitTest_TestFCP2() { var array = UnitTest_TestFCP2Sub(); int count = array.Count; - for(int i=0;i< count; ++i) + for (int i = 0; i < count; ++i) { - for(int j = 0; j < CachePosSnDic.Length; j++) + for (int j = 0; j < CachePosSnDic.Length; j++) { if (CachePosSnDic[j] == null) CachePosSnDic[j] = new Dictionary(); @@ -195,7 +195,7 @@ public static void UnitTest_TestFCP2() var tabarray = UnitTest_TestFCP2Sub2(); int tabCount = tabarray.Count; - for(int i = 0; i < tabCount; ++i) + for (int i = 0; i < tabCount; ++i) { tabHasItemDic.Add(tabarray[i].TestVal2, false); } @@ -238,13 +238,13 @@ static List UnitTest_TestFCP2Sub2() public static void UnitTest_TestFCP3() { - for(int i = 0; i < 100; i++) + for (int i = 0; i < 100; i++) { try { throw new Exception("test"); } - catch(Exception ex) + catch (Exception ex) { Console.WriteLine($"{ex.Message}\r\n{ex.Data["StackTrace"]}"); } @@ -317,5 +317,43 @@ public static void UnitTest_TestStackRegisterTransition2() } } + + struct TransitionTest + { + public int A; + public string B; + public float C; + public TransitionTestSub D; + } + struct TransitionTestSub + { + public string A; + public int B; + public float C; + } + class TransitionTest2 + { + public void Test(TransitionTest arg) + { + if (arg.A != 1 || arg.B != "2" || arg.C != 3) + throw new Exception(); + if(arg.D.A != "4" || arg.D.B != 5 || arg.D.C != 6) + throw new Exception(); + } + } + [ILRuntimeJIT(ILRuntimeJITFlags.NoJIT)] + public static void UnitTest_TestStackRegisterTransition3() + { + TransitionTest t = new TransitionTest(); + t.A = 1; + t.B = "2"; + t.C = 3; + t.D.A = "4"; + t.D.B = 5; + t.D.C = 6; + + TransitionTest2 cls = new TransitionTest2(); + cls.Test(t); + } } }