X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mono%2Fmini%2Fgshared.cs;h=75ea14aad6a91463ecc7f3ba0eb2769e97f7be1d;hb=HEAD;hp=29943694c72fa7ccbf6bbc98256a040792325fd8;hpb=6ac36d6c40a2dd0ab2800c23d08894856b193c2f;p=mono.git diff --git a/mono/mini/gshared.cs b/mono/mini/gshared.cs index 29943694c72..75ea14aad6a 100644 --- a/mono/mini/gshared.cs +++ b/mono/mini/gshared.cs @@ -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 (ref t); } + public static int test_42_gsharedvt_constrained_iface_vtype () { + IFaceConstrainedIFace obj = new ConstrainedIFace (); + IFaceTest t = new StructTest (42); + return obj.foo (ref t); + } + // Sign extension tests // 0x55 == 85 == 01010101 // 0xAA == 170 == 10101010 @@ -1972,6 +1991,32 @@ public class Tests gsharedvt_vphi (0); return 0; } + + struct AStruct3 { + T1 t1; + T2 t2; + T3 t3; + } + + interface IFaceIsRef { + bool is_ref (); + } + + class ClassIsRef : IFaceIsRef { + [MethodImplAttribute (MethodImplOptions.NoInlining)] + public bool is_ref () { + return RuntimeHelpers.IsReferenceOrContainsReferences (); + } + } + + public static int test_0_isreference_intrins () { + IFaceIsRef iface = new ClassIsRef (); + if (iface.is_ref> ()) + return 1; + if (!iface.is_ref> ()) + return 2; + return 0; + } } // #13191