diff options
author | Rodrigo Kumpera <kumpera@gmail.com> | 2007-06-06 03:41:16 +0400 |
---|---|---|
committer | Rodrigo Kumpera <kumpera@gmail.com> | 2007-06-06 03:41:16 +0400 |
commit | 3756770e50387ed434a505319192f859c406c037 (patch) | |
tree | 3f56ee32e6da5577af9d3407c42b65c9d49606b3 | |
parent | 2d03dc4a2227c0b7fba5c2fe4aa94cfc55200aa6 (diff) |
2007-06-05 Rodrigo Kumpera <kumpera@gmail.com
* generics-variance.il: New. Test for variance related generic modifiers <+T> and <-T>
svn path=/trunk/mcs/; revision=78687
-rw-r--r-- | mcs/ilasm/tests/ChangeLog | 4 | ||||
-rw-r--r-- | mcs/ilasm/tests/generics-variance.il | 43 |
2 files changed, 47 insertions, 0 deletions
diff --git a/mcs/ilasm/tests/ChangeLog b/mcs/ilasm/tests/ChangeLog index 25461b8e849..c656565ff66 100644 --- a/mcs/ilasm/tests/ChangeLog +++ b/mcs/ilasm/tests/ChangeLog @@ -1,3 +1,7 @@ +2007-06-05 Rodrigo Kumpera <kumpera@gmail.com + + * generics-variance.il: New. Test for variance related generic modifiers <+T> and <-T> + 2007-01-11 Ankit Jain <jankit@novell.com> * test-custom-mod-1.il: New. Test for custom mods. diff --git a/mcs/ilasm/tests/generics-variance.il b/mcs/ilasm/tests/generics-variance.il new file mode 100644 index 00000000000..6be5c0e1757 --- /dev/null +++ b/mcs/ilasm/tests/generics-variance.il @@ -0,0 +1,43 @@ +// +// Test a generic type type param field +// + +.assembly extern mscorlib { } + + +.namespace Mono.ILASM.Tests { + +.class public Covariant<+T> extends [mscorlib]System.Object { + + .field public !0 val + + .method public instance void .ctor () { + ret + } +} + +.class public Contravariant<-T> extends [mscorlib]System.Object { + + .field public !0 val + + .method public instance void .ctor () { + ret + } +} + +.class public Driver extends [mscorlib]System.Object { + + .method public static void Main () { + .entrypoint + newobj instance void class Mono.ILASM.Tests.Covariant<string>::.ctor () + castclass class Mono.ILASM.Tests.Covariant<object> + call void [mscorlib]System.Console::WriteLine (object) + + newobj instance void class Mono.ILASM.Tests.Covariant<object>::.ctor () + castclass class Mono.ILASM.Tests.Covariant<string> + call void [mscorlib]System.Console::WriteLine (object) + + ret + } +} +}
\ No newline at end of file |