CHECK_CFG_ERROR;
}
}
+
+ if (constrained_class->enumtype && !strcmp (cmethod->name, "GetHashCode")) {
+ /* Use the corresponding method from the base type to avoid boxing */
+ MonoType *base_type = mono_class_enum_basetype (constrained_class);
+ g_assert (base_type);
+ constrained_class = mono_class_from_mono_type (base_type);
+ cmethod = mono_class_get_method_from_name (constrained_class, cmethod->name, 0);
+ g_assert (cmethod);
+ }
}
if (!dont_verify && !cfg->skip_visibility) {
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__