diff options
Diffstat (limited to 'tests/src/JIT/Methodical/structs/systemvbringup/structrettest.cs')
-rw-r--r-- | tests/src/JIT/Methodical/structs/systemvbringup/structrettest.cs | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/tests/src/JIT/Methodical/structs/systemvbringup/structrettest.cs b/tests/src/JIT/Methodical/structs/systemvbringup/structrettest.cs index a5ebce5597..d8a74d7d97 100644 --- a/tests/src/JIT/Methodical/structs/systemvbringup/structrettest.cs +++ b/tests/src/JIT/Methodical/structs/systemvbringup/structrettest.cs @@ -38,12 +38,18 @@ namespace structinreg public float f1; } + struct Test35 + { + public Foo3 foo1; + public Foo3 foo2; + } class Program0 { [MethodImplAttribute(MethodImplOptions.NoInlining)] Test30 test1() { + Console.WriteLine("From Program0:test1!"); Test30 test1 = default(Test30); test1.i1 = 1; test1.i2 = 2; @@ -54,6 +60,7 @@ namespace structinreg [MethodImplAttribute(MethodImplOptions.NoInlining)] Test31 test2() { + Console.WriteLine("From Program0:test2!"); Test31 test2 = default(Test31); Foo3 foo = new Foo3(); foo.iFoo = 3; @@ -64,6 +71,7 @@ namespace structinreg [MethodImplAttribute(MethodImplOptions.NoInlining)] Test32 test3() { + Console.WriteLine("From Program0:test3!"); Test32 test3 = default(Test32); Foo3 foo = new Foo3(); foo.iFoo = 4; @@ -75,6 +83,7 @@ namespace structinreg [MethodImplAttribute(MethodImplOptions.NoInlining)] Test33 test4() { + Console.WriteLine("From Program0:test4!"); Test33 test4 = default(Test33); Foo3 foo1 = new Foo3(); Foo3 foo2 = new Foo3(); @@ -104,6 +113,24 @@ namespace structinreg } [MethodImplAttribute(MethodImplOptions.NoInlining)] + Test35 test6(Test35 t5) + { + int fRes = t5.foo1.iFoo + t5.foo2.iFoo; + Console.WriteLine("From Test6 members: {0} {1}", t5.foo1.iFoo, t5.foo2.iFoo); + Console.WriteLine("From Test6: Res {0}", fRes); + if (fRes != 43) { + throw new Exception("Failed inside test6 test!"); + } + + Test35 tst5 = default(Test35); + tst5.foo1 = new Foo3(); + tst5.foo2 = new Foo3(); + tst5.foo1.iFoo = 28; + tst5.foo2.iFoo = 29; + return tst5; + } + + [MethodImplAttribute(MethodImplOptions.NoInlining)] public static int Main1() { Program0 p = new Program0(); @@ -149,6 +176,19 @@ namespace structinreg throw new Exception("Failed test5 test!"); } + Test35 test6 = default(Test35); + test6.foo1 = new Foo3(); + test6.foo2 = new Foo3(); + test6.foo1.iFoo = 21; + test6.foo2.iFoo = 22; + + Test35 t6Res = p.test6(test6); + + Console.WriteLine("test6 Result: {0}", t6Res.foo1.iFoo + t6Res.foo2.iFoo); + if ((t6Res.foo1.iFoo + t6Res.foo2.iFoo) != 57) { + throw new Exception("Failed test6 test!"); + } + return 100; } } |