Add g_getdtablesize to list of acceptable g_* symbols in mono, for test-eglib-remap
[mono.git] / mono / mini / generics.cs
index 17a70af71b8e3324bbfe69eb4b15f3a1d7694cd0..f350710c76e1b04e60e407212595aa47fe84b08b 100644 (file)
@@ -906,6 +906,21 @@ class Tests
                return result;
        }
 
+       class SyncClass<T> {
+               [MethodImpl(MethodImplOptions.Synchronized)]
+               public Type getInstance() {
+                       return typeof (T);
+               }
+       }
+
+       [Category ("GSHAREDVT")]
+       static int test_0_synchronized_gshared () {
+               var c = new SyncClass<string> ();
+               if (c.getInstance () != typeof (string))
+                       return 1;
+               return 0;
+       }
+
        class Response {
        }
 
@@ -1065,6 +1080,45 @@ class Tests
                return 0;
        }
 #endif
+
+       public static int test_0_delegate_callvirt_fullaot () {
+               Func<string> f = delegate () { return "A"; };
+        var f2 = (Func<Func<string>, string>)Delegate.CreateDelegate (typeof
+(Func<Func<string>, string>), null, f.GetType ().GetMethod ("Invoke"));
+
+        var s = f2 (f);
+               return s == "A" ? 0 : 1;
+       }
+
+    public interface ICovariant<out R>
+    {
+    }
+
+    // Deleting the `out` modifier from this line stop the problem
+    public interface IExtCovariant<out R> : ICovariant<R>
+    {
+    }
+
+    public class Sample<R> : ICovariant<R>
+    {
+    }
+
+    public interface IMyInterface
+    {
+    }
+
+       public static int test_0_variant_cast_cache () {
+               object covariant = new Sample<IMyInterface>();
+
+               var foo = (ICovariant<IMyInterface>)(covariant);
+
+               try {
+                       var extCovariant = (IExtCovariant<IMyInterface>)covariant;
+                       return 1;
+               } catch {
+                       return 0;
+               }
+       }
 }
 
 #if !MOBILE