Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/corert.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'tests/src/Simple/Generics/Generics.cs')
-rw-r--r--tests/src/Simple/Generics/Generics.cs58
1 files changed, 58 insertions, 0 deletions
diff --git a/tests/src/Simple/Generics/Generics.cs b/tests/src/Simple/Generics/Generics.cs
index 3b5386b34..fe16f5b71 100644
--- a/tests/src/Simple/Generics/Generics.cs
+++ b/tests/src/Simple/Generics/Generics.cs
@@ -31,6 +31,8 @@ class Program
TestGvmDependencies.Run();
TestFieldAccess.Run();
TestNativeLayoutGeneration.Run();
+ TestInterfaceVTableTracking.Run();
+ TestClassVTableTracking.Run();
return 100;
}
@@ -2088,4 +2090,60 @@ class Program
throw new Exception();
}
}
+
+ class TestInterfaceVTableTracking
+ {
+ class Gen<T> { }
+
+ interface IFoo<T>
+ {
+ Array Frob();
+ }
+
+ class GenericBase<T> : IFoo<T>
+ {
+ public Array Frob()
+ {
+ return new Gen<T>[1,1];
+ }
+ }
+
+ class Derived<T> : GenericBase<Gen<T>>
+ {
+ }
+
+ static volatile IFoo<Gen<string>> s_foo;
+
+ public static void Run()
+ {
+ // This only really tests whether we can compile this.
+ s_foo = new Derived<string>();
+ Array arr = s_foo.Frob();
+ arr.SetValue(new Gen<Gen<string>>(), new int[] { 0, 0 });
+ }
+ }
+
+ class TestClassVTableTracking
+ {
+ class Unit { }
+
+ class Gen<T, U>
+ {
+ public virtual int Test()
+ {
+ return 42;
+ }
+ }
+
+ static int Call<T>()
+ {
+ return new Gen<T, Unit>().Test();
+ }
+
+ public static void Run()
+ {
+ // This only really tests whether we can compile this.
+ Call<object>();
+ }
+ }
}