[CI] ignore appdomain-unload-asmload.exe on interp and full-aot
[mono.git] / mono / tests / generic-virtual.2.cs
index 257d39b416832b0e344af601077d5dda6bc680d1..3cf9ce579d13a72854597f270148bb0625e89940 100644 (file)
@@ -56,27 +56,42 @@ public class main {
                Gen<ClassA> ga = new Gen<ClassA> ();
                Gen<ClassA> gsa = new GenSub<ClassA> ();
                Gen<ClassA> gss = new GenSubSub ();
-
-               if (!ga.test ())
-                       return 1;
-               if (!gsa.test ())
-                       return 1;
-               if (!gss.test ())
-                       return 1;
-
-               StringArrayDelegate sad = new StringArrayDelegate (GenSubSub.staticNewArr<string>);
-               string[] arr = sad ();
-               if (arr.GetType () != typeof (string[]))
-                       return 1;
-               if (arr.Length != 5)
-                       return 1;
-
-               sad = new StringArrayDelegate (gss.newArr<string>);
-               arr = sad ();
-               if (arr.GetType () != typeof (string[]))
-                       return 1;
-               if (arr.Length != 5)
-                       return 1;
+               int i;
+
+               for (i = 0; i < 100; ++i) {
+                       if (!ga.test ())
+                               return 1;
+                       if (!gsa.test ())
+                               return 1;
+                       if (!gss.test ())
+                               return 1;
+
+                       StringArrayDelegate sad = new StringArrayDelegate (GenSubSub.staticNewArr<string>);
+                       string[] arr = sad ();
+                       if (arr.GetType () != typeof (string[]))
+                               return 1;
+                       if (arr.Length != 5)
+                               return 1;
+
+                       sad = new StringArrayDelegate (gss.newArr<string>);
+                       arr = sad ();
+                       if (arr.GetType () != typeof (string[]))
+                               return 1;
+                       if (arr.Length != 5)
+                               return 1;
+               }
+
+               /* A test for rebuilding generic virtual thunks */
+               for (i = 0; i < 1000; ++i) {
+                       object o = ga.newArr<string> ();
+                       if (!(o is string[]))
+                               return 2;
+               }
+               for (i = 0; i < 1000; ++i) {
+                       object o = ga.newArr<object> ();
+                       if (!(o is object[]))
+                               return 2;
+               }
 
                return 0;
        }