diff options
author | Jan Kotas <jkotas@microsoft.com> | 2017-01-26 12:41:45 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-26 12:41:45 -0800 |
commit | 0bc4bffb923a792ac15b070610fe40a4e4629146 (patch) | |
tree | fc9639d595942b41dd3bd4269d1a549652721052 /tests | |
parent | 63b07cc9c659642d6fb00fecf5a7b2683c82f4b1 (diff) | |
download | coreclr-0bc4bffb923a792ac15b070610fe40a4e4629146.tar.gz coreclr-0bc4bffb923a792ac15b070610fe40a4e4629146.tar.bz2 coreclr-0bc4bffb923a792ac15b070610fe40a4e4629146.zip |
Fix encoding of native signatures in the presence of Enum.GetHashCode optimization (#9138)
Fixes #9118
Diffstat (limited to 'tests')
-rw-r--r-- | tests/src/readytorun/main.cs | 5 | ||||
-rw-r--r-- | tests/src/readytorun/test.cs | 7 |
2 files changed, 12 insertions, 0 deletions
diff --git a/tests/src/readytorun/main.cs b/tests/src/readytorun/main.cs index bbdd101759..783c1fd3cb 100644 --- a/tests/src/readytorun/main.cs +++ b/tests/src/readytorun/main.cs @@ -99,6 +99,11 @@ class Program { ((Object)s).ToString(); } + + // Enum.GetHashCode optimization requires special treatment + // in native signature encoding + MyEnum e = MyEnum.Apple; + e.GetHashCode(); } static void TestConstrainedMethodCalls_Unsupported() diff --git a/tests/src/readytorun/test.cs b/tests/src/readytorun/test.cs index 40199b41e8..8a6beaea15 100644 --- a/tests/src/readytorun/test.cs +++ b/tests/src/readytorun/test.cs @@ -403,3 +403,10 @@ public class ByteChildClass : ByteBaseClass ChildByte = 67; } } + +public enum MyEnum +{ + Apple = 1, + Banana = 2, + Orange = 3 +} |