Skip to content

Commit

Permalink
2008-06-23 Mark Probst <mark.probst@gmail.com>
Browse files Browse the repository at this point in the history
	* 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 62f2ae3
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
8 changes: 8 additions & 0 deletions mono/tests/ChangeLog
@@ -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
Expand Down
4 changes: 3 additions & 1 deletion mono/tests/Makefile.am
Expand Up @@ -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 \
Expand Down Expand Up @@ -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; \
Expand Down
22 changes: 22 additions & 0 deletions mono/tests/generic-virtual2.2.cs
@@ -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.