diff options
author | Lubomir Litchev <lubol@microsoft.com> | 2016-02-24 21:26:55 -0800 |
---|---|---|
committer | Lubomir Litchev <lubol@microsoft.com> | 2016-02-29 15:55:02 -0800 |
commit | 31cb7975335b33bd04268216e3409a4cd6e9dc29 (patch) | |
tree | 1d62ede86a5918ad44876f3196e25202c4e4dd58 /tests/src | |
parent | e9fa953a295d16b7e00e9192b4973743398358e9 (diff) | |
download | coreclr-31cb7975335b33bd04268216e3409a4cd6e9dc29.tar.gz coreclr-31cb7975335b33bd04268216e3409a4cd6e9dc29.tar.bz2 coreclr-31cb7975335b33bd04268216e3409a4cd6e9dc29.zip |
Add support for emitting GC-ness of the second return register for 16 byte
structs.
This changeset adds support for emitting the GC-ness of the second return
register (RDX for System V Amd64) for multi-register return structs.
It closes a hole in the GC info and resolves multiple GC stress failures.
Fixes #2757.
Diffstat (limited to 'tests/src')
-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; } } |