Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mono / mini / gshared.cs
index 61402f7a4eca4f0314d21eb7918cf5e16ae02a00..75ea14aad6a91463ecc7f3ba0eb2769e97f7be1d 100644 (file)
@@ -1823,6 +1823,19 @@ public class Tests
                }
        }
 
+       struct StructTest : IFaceTest {
+
+               int i;
+
+               public StructTest (int arg) {
+                       i = arg;
+               }
+
+               public int iface_method () {
+                       return i;
+               }
+       }
+
        // Test constrained calls on an interface made from gsharedvt methods
        public static int test_42_gsharedvt_constrained_iface () {
                IFaceConstrainedIFace obj = new ConstrainedIFace ();
@@ -1830,6 +1843,12 @@ public class Tests
                return obj.foo<IFaceTest, int> (ref t);
        }
 
+       public static int test_42_gsharedvt_constrained_iface_vtype () {
+               IFaceConstrainedIFace obj = new ConstrainedIFace ();
+               IFaceTest t = new StructTest (42);
+               return obj.foo<IFaceTest, int> (ref t);
+       }
+
        // Sign extension tests
        // 0x55   == 85    == 01010101
        // 0xAA   == 170   == 10101010
@@ -1992,8 +2011,10 @@ public class Tests
 
        public static int test_0_isreference_intrins () {
                IFaceIsRef iface = new ClassIsRef ();
-               Console.WriteLine ("X: " + iface.is_ref<AStruct3<int, int, int>> ());
-               Console.WriteLine ("X: " + iface.is_ref<AStruct3<string, int, int>> ());
+               if (iface.is_ref<AStruct3<int, int, int>> ())
+                       return 1;
+               if (!iface.is_ref<AStruct3<string, int, int>> ())
+                       return 2;
                return 0;
        }
 }