Permalink
Browse files

2008-06-23 Mark Probst <mark.probst@gmail.com>

	* generic-virtual2.2.cs: Test case for a call from a generic
	method to a method of a generic class where the generic method
	does not require the MRGCTX.

	* Makefile.am: Test added.

svn path=/trunk/mono/; revision=106447
  • Loading branch information...
schani committed Jun 23, 2008
1 parent eba9c11 commit 62f2ae3bc0f144398a6cb901578e63e4706d6799
Showing with 33 additions and 1 deletion.
  1. +8 −0 mono/tests/ChangeLog
  2. +3 −1 mono/tests/Makefile.am
  3. +22 −0 mono/tests/generic-virtual2.2.cs
View
@@ -1,3 +1,11 @@
+2008-06-23 Mark Probst <mark.probst@gmail.com>
+
+ * generic-virtual2.2.cs: Test case for a call from a generic
+ method to a method of a generic class where the generic method
+ does not require the MRGCTX.
+
+ * Makefile.am: Test added.
+
2008-06-23 Mark Probst <mark.probst@gmail.com>
* generic-exceptions.2.cs: Test case for exception handlers in
View
@@ -275,6 +275,7 @@ BASE_TEST_CS_SRC= \
generic-null-call.2.cs \
generic-special.2.cs \
generic-exceptions.2.cs \
+ generic-virtual2.2.cs \
recursive-generics.2.cs \
bug-80392.2.cs \
dynamic-method-access.2.cs \
@@ -709,7 +710,8 @@ test-generic-sharing : generics-sharing.2.exe shared-generic-methods.2.exe \
generic-method-patching.2.exe generic-static-methods.2.exe \
generic-null-call.2.exe generic-tailcall2.2.exe \
generic-array-exc.2.exe generic-special.2.exe \
- generic-exceptions.2.exe
+ generic-exceptions.2.exe \
+ generic-virtual2.2.exe
for fn in $+ ; do \
echo "Testing $$fn ..."; \
MONO_GENERIC_SHARING=all $(RUNTIME) -O=gshared $$fn || exit 1; \
@@ -0,0 +1,22 @@
+public struct GenStruct<T> {
+}
+
+public class Gen<T> {
+ public object doCall<S> (GenStruct<T> x) {
+ return newArr (x);
+ }
+
+ public object newArr (GenStruct<T> x) {
+ return new T [3];
+ }
+}
+
+public class main {
+ public static int Main () {
+ Gen<string> gs = new Gen<string> ();
+
+ if (gs.doCall<object> (new GenStruct<string> ()).GetType () != typeof (string []))
+ return 1;
+ return 0;
+ }
+}

0 comments on commit 62f2ae3

Please sign in to comment.