+
+ public interface IComparer2
+ {
+ Type foo<T> ();
+ }
+
+ public class AClass : IComparer2 {
+ public Type foo<T> () {
+ return typeof(T);
+ }
+ }
+
+ public static int test_0_delegate_to_virtual_generic_on_ifaces () {
+ IComparer2 c = new AClass ();
+
+ Func<Type> f = c.foo<string>;
+ return f () == typeof(string) ? 0 : 1;
+ }
+
+ public enum ByteEnum2 : byte {
+ High = 142
+ }
+
+ [MethodImplAttribute (MethodImplOptions.NoInlining)]
+ public static int enum_arg_zero_extend (ByteEnum2 b) {
+ return (int)b;
+ }
+
+ 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;
+ }
+
+ public static int test_0_typedref () {
+ int i = 5;
+ System.TypedReference r = __makeref(i);
+ System.Type t = __reftype(r);
+
+ if (t != typeof (int))
+ return 1;
+ int j = __refvalue(r, int);
+ if (j != 5)
+ return 2;
+
+ try {
+ object o = __refvalue (r, object);
+ } catch (InvalidCastException) {
+ }
+
+ return 0;
+ }