[jit] Optimize constrained calls to Enum.GetHasCode () to avoid boxing. Fixes #51330...
[mono.git] / mono / mini / objects.cs
index 32b92286c914855e53e94636f34abd9d6333cf8e..f378cd205975116ef86c5aefde7e4267d99b545b 100644 (file)
@@ -1765,6 +1765,16 @@ ncells ) {
        public static int test_142_byte_enum_arg_zero_extend () {
                return enum_arg_zero_extend (ByteEnum2.High);
        }
+
+       enum Mine { One, Two }
+
+       public static int test_0_enum_gethashcode_opt () {
+               int sum = 0;
+        for (int i = 0; i < 1000000; ++i)
+                       sum += Mine.Two.GetHashCode();
+
+        return 0;
+    }
 }
 
 #if __MOBILE__