summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJan Kotas <jkotas@microsoft.com>2017-01-26 12:41:45 -0800
committerGitHub <noreply@github.com>2017-01-26 12:41:45 -0800
commit0bc4bffb923a792ac15b070610fe40a4e4629146 (patch)
treefc9639d595942b41dd3bd4269d1a549652721052 /tests
parent63b07cc9c659642d6fb00fecf5a7b2683c82f4b1 (diff)
downloadcoreclr-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.cs5
-rw-r--r--tests/src/readytorun/test.cs7
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
+}