Imported Upstream version 3.6.0

Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
This commit is contained in:
Jo Shields
2014-08-13 10:39:27 +01:00
commit a575963da9
50588 changed files with 8155799 additions and 0 deletions

344
mcs/ilasm/tests/ChangeLog Normal file
View File

@@ -0,0 +1,344 @@
2008-07-02 Ankit Jain <jankit@novell.com>
* test-method-pointer.il: New.
2007-12-31 Rodrigo Kumpera <rkumpera@novell.com>
* test-emitbyte.il: new test for .emitbyte directive
2007-10-09 Rodrigo Kumpera <rkumpera@novell.com>
* test-method-pointer-in-signature.il: New. Test for overloads
that use method pointers.
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.
2006-07-20 Ankit Jain <jankit@novell.com>
* global2.il: New.
* abs_method*.il: New. Tests for abstract methods.
2006-06-07 Ankit Jain <jankit@novell.com>
* test-no-body.il: New. Test for method with no body.
* test-perm-pass-3.il: Make the class abstract.
2006-06-01 Ankit Jain <jankit@novell.com>
* test-cattr-1.il: New. Test for custom attributes on return type of
a method.
2006-05-26 Ankit Jain <jankit@novell.com>
* test-perm_pass-3.il: New. Test for 2.0 style declarative security
attributes.
2006-05-11 Ankit Jain <jankit@novell.com>
* test-modifiers.il: New. Test for custom modifiers, modreq & modopt.
2006-05-09 Sebastien Pouliot <sebastien@ximian.com>
* test-sn-key.il: New. Added test case when /key is used but the IL
source doesn't include a .publickey directive or any attribute that
loads the public key.
* test-sn-module.il: New. Added test case when /key is used when
assembling a netmodule (signing shouldn't occur).
2006-04-24 Ankit Jain <jankit@novell.com>
* test-module.il: New. Test for a netmodule.
2006-02-22 Ankit Jain <jankit@novell.com>
* test-nonsealed-valueclass.il: New. Value class should be sealed.
2006-02-20 Ankit Jain <jankit@novell.com>
* generics-al.i, test-29.il: Remove. These use invalid style of
specifying generic constraints.
2006-02-19 Ankit Jain <jankit@novell.com>
* invalid-method.il: New. Reference to undefined method.
* invalid-field.il: New. Reference to undefined field.
2006-01-31 Ankit Jain <jankit@novell.com>
* test-assembly2.il: New. Test for referencing undeclared external assembly.
2006-01-23 Ankit Jain <jankit@novell.com>
* err-*.il, test-perm_fail*.il: Move negative tests from here to errors/ .
2006-01-19 Ankit Jain <jankit@novell.com>
* test-module-cattr.il: New. Test for custom attributes on .module
* test-array-2.i: Add the missing closing brace.
2006-01-19 Ankit Jain <jankit@novell.com>
* err-gen-cattr-1.il: New.
* err-gen-cattr-2.il: New.
* err-gen-cattr-3.il: New.
* err-gen-cattr-4.il: New.
2006-01-16 Ankit Jain <jankit@novell.com>
* test-int64.il: New. Test for large numeric values.
2006-01-16 Ankit Jain <jankit@novell.com>
* test-array-2.il: New. Test for methodref to Array's methods.
eg. class test [,]::.ctor (int32, int32)
2006-01-15 Ankit Jain <jankit@novell.com>
* test-override-1.il:
* test-override-2.il: New. Test for 'full' syntax of specifying
overrides. (.override method ..full sig.. )
2006-01-14 Ankit Jain <jankit@novell.com>
* gen-instr1.il: New. Test for using GenericParams as operands to
type instructions.
2006-01-11 Ankit Jain <jankit@novell.com>
* gen-nested2.il: New.
* gen-nested3.il: New. Test for new syntax for specifying namespace ie.,
as part of the type name instead of using '.namespace' directive.
2006-01-10 Ankit Jain <jankit@novell.com>
* gen-nested.il: New. Test for a generic type nested in a non-generic
one.
2006-01-10 Ankit Jain <jankit@novell.com>
* gen-meth3.il: New. Test for abstract generic method.
2006-01-10 Ankit Jain <jankit@novell.com>
* gen-meth1.il: New. Test for use of VAR/MVAR by name (!!A)
* gen-meth2.il: New. Test for using VAR/MVAR as class ref.
2006-01-09 Ankit Jain <jankit@novell.com>
* gen-recur.il: New. Test for a class implementing a generic interface
with the class itself as the argument.
2006-01-07 Ankit Jain <jankit@novell.com>
* gen-constraints1.il: New. Test for constraints on generic parameters.
2006-01-06 Ankit Jain <jankit@novell.com>
* test-field-init.il: New. Test for field initialization (simple signed/unsigned
int variants).
2006-01-06 Ankit Jain <jankit@novell.com>
* test-perm_pass-2.il: New. Test for new(2.0) syntax of specifying value
of a permissionset, which uses string instead of a bytearray.
2006-01-05 Ankit Jain <jankit@novell.com>
* gen-extern-type.il: New. Test for ref to an external generic type.
* gen-array1.il, gen-array-2.il: New. Test for duplicate typespecs for
generic types and arrays of the same.
* gen-interf-1.il, gen-interf-2.il: New. Test for inheriting from a generic
base class and implementing generic interfaces.
* gen-struct.il: New. Test for generic valuetype.
* gen-local.il: New. No entry in the TypeSpec table should be emitted if a
generic type is referenced only as a local var.
* one.cs, two.cs: Updated to include types required the new tests.
2006-01-03 Ankit Jain <jankit@novell.com>
* gen-dotted-name.il: New. Test for dotted-name of a generic type.
2005-12-16 Ankit Jain <jankit@novell.com>
Tests for fields with same name but different types.
* field-dup1.il, field-dup-gen2.il: Positive tests.
* err-field-dup1.il, err-field-dup2.il, err-field-dup3.il,
err-field-dup4.il, err-field-dup5.il, err-field-dup6-gen.il,
err-field-dup7-gen.il: Negative tests.
* one.cs, two.cs, oneg.cs: Required for use by above test cases.
2005-12-15 Ankit Jain <jankit@novell.com>
* test-array.il: Oops, contained two copies of the test case.
2005-12-15 Ankit Jain <jankit@novell.com>
* assembly.il: New. Test for multiple .assembly declarations.
* err-assembly.il: New. Negative test for the same.
2005-12-14 Ankit Jain <jankit@novell.com>
* test-bounded-array.il: New. Test for [0...], should not lose its
lower bound info.
2005-12-14 Ankit Jain <jankit@novell.com>
* test-array.il: New. Test for tokenizing 0...8
2005-12-14 Ankit Jain <jankit@novell.com>
* test-uint.il: New. Test for keywords uint8, uint16, uint32 & uint64.
2005-12-14 Ankit Jain <jankit@novell.com>
* dotted-names.il: Add test for class with no explicit namespace.
2005-12-13 Ankit Jain <jankit@novell.com>
* dotted-names.il: New. Test for dotted names in namespace, class.
2005-12-12 Ankit Jain <jankit@novell.com>
* nested.il: New. Ensure nested visibility for nested types.
2005-12-12 Ankit Jain <jankit@novell.com>
* gen-1.il:New. Generic method reference.
* err-gen-2.il:
* err-gen-3.il: New. Negative tests for generic method refernce.
* global.il: New. Global generic method ref.
* gen-field.il: New. Generic field reference. (Compiles fine, but
will have PEVerify errors)
2005-11-23 Ankit Jain <jankit@novell.com>
* test-33.il:
* test-34.il: New. Tests for custom attributes on type parameters.
2005-09-15 Ankit Jain <jankit@novell.com>
* test-perm_fail-[1234].il: New. Negative Tests for .permission directive.
* test-perm_pass-1.il: New. Test for .permission directive.
2005-08-23 Ankit Jain <jankit@novell.com>
* test-byref.il: New. Test for a call with byref return type.
2005-08-18 Ankit Jain <jankit@novell.com>
* test-sec-suppress.il: New. Test for SuppressUnmanagedCodeSecurity
custom attribute, type or method should get a HasSecurity attribute.
2005-08-18 Ankit Jain <jankit@novell.com>
* test-ldcr-bytes.il: New. Test for "ldc.r8/r4" followed by a byte array.
2005-08-18 Ankit Jain <jankit@novell.com>
* test-cattr-declsec.il: New. Added test for custom attrs and decl sec
on interface methods.
2005-08-16 Ankit Jain <jankit@novell.com>
* test-marshal-array.il: New. Added test for marshalling as native type array.
* test-marshal.il: New. Added test for marshal info for method params.
* test-fixedarray.il: New. Added test for marshalling as fixed array.
* test-safearray.il: New. Added test for marshalling as safe array.
2004-12-10 Sebastien Pouliot <sebastien@ximian.com>
* test-sn.il: New. Added test when including a public key to test for
strongnaming an assembly (/key option).
* sn.snk: New. Strongname key for the test-sn.il test.
2003-07-12 Zoltan Varga <vargaz@freemail.hu>
* test-31.il: Added tests for static properties. Also made the code
for methods verifiable IL.
Fri Jul 25 12:27:24 CEST 2003 Paolo Molaro <lupus@ximian.com>
* generics-c.il, generics-b.il: add constructors and fix code.
2003-07-14 Jackson Harper <jackson@latitudegeo.com>
* test-11.il: Don't specify constraints with ids anymore
* test-29.il: Remove uneeded class, add constraint
2003-03-31 Jackson Harper <jackson@latitudegeo.com>
* test-10.il: New test, does some bounded array stuff
2003-03-17 Jackson Harper <jackson@latitudegeo.com>
* tests: Update to valid il code.
2003-03-17 Jackson Harper <jackson@latitudegeo.com>
* test-9.il: Add output to the constructor so I know it is called, give
the constructor the instance call conv.
2003-03-16 Jackson Harper <jackson@latitudegeo.com>
* test-9.il: New test, test instaniating a class
2003-03-06 Jackson Harper <jackson@latitudegeo.com>
* test-8.il: New test, test creating a class that inherits from something other then System.Object
2003-03-06 Jackson Harper <jackson@latitudegeo.com>
* test-6.il: Define class that field references
2003-03-06 Jackson Harper <jackson@latitudegeo.com>
* makefile: add some tests
* test-5.il, test-6.il, test-7.il: New tests, test field declaration
2003-02-10 Jackson Harper <jackson@latitudegeo.com>
* makefile: remove unneeded rm's
2003-02-10 Jackson Harper <jackson@latitudegeo.com>
* test-4.il: Add file
* makefile: Add new test
2003-02-09 Jackson Harper <jackson@latitudegeo.com>
* test-3.il: Add file
* makefile: Add new test
2003-02-08 Jackson Harper <jackson@latitudegeo.com>
* test-1.il: Change class name
2003-02-08 Jackson Harper <jackson@latitudegeo.com>
* test-2.il: Add new test
* makefile: Use new test
2003-02-04 Jackson Harper <jackson@latitudegeo.com>
* test-1.il: Add header, put in a namespace
2003-02-04 Jackson Harper <jackson@latitudegeo.com>
* makefile: Use .il files not .cs ;-)
2003-02-04 Jackson Harper <jackson@latitudegeo.com>
* HelloWorld.il: Remove
* test-1.il: New test
* makefile: Added file
2003-02-02 Jackson Harper <jackson@latitudegeo.com>
* HelloWorld.il: Add HelloWorld test
* ChangeLog: Add ChangeLog

View File

@@ -0,0 +1,10 @@
//Interface not marked abstract,
//abstract instance method
.class public interface Test
{
.method public newslot instance object Foo ()
{ }
}

View File

@@ -0,0 +1,10 @@
//Abstract static method
.class public abstract Test
{
.method public static abstract newslot object Foo ()
{
}
}

View File

@@ -0,0 +1,10 @@
//Interface not marked abstract,
//abstract static method
.class public interface Test
{
.method public newslot static object Foo ()
{ }
}

View File

@@ -0,0 +1,13 @@
//Interface not marked abstract,
//static method with body
.class public interface Test
{
.method public newslot static object Foo ()
{
ldnull
ret
}
}

View File

@@ -0,0 +1,13 @@
//Abstract class,
//instance method with body
.class public abstract Test
{
.method public newslot object Foo ()
{
ldnull
ret
}
}

View File

@@ -0,0 +1,11 @@
//Abstract class,
//instance method with no body
.class public abstract Test
{
.method public newslot object Foo ()
{
}
}

View File

@@ -0,0 +1,13 @@
//Abstract class,
//static method with body
.class public abstract Test
{
.method public static newslot object Foo ()
{
ldnull
ret
}
}

View File

@@ -0,0 +1,11 @@
//Abstract class,
//static method with no body
.class public abstract Test
{
.method public static newslot object Foo ()
{
}
}

View File

@@ -0,0 +1,13 @@
//Multiple .assembly declarations but with same name (valid)
.assembly extern mscorlib
{
.ver 1:0:5000:0
}
.assembly 'test'
{
.hash algorithm 0x00008004
}
.assembly 'test'
{
}

View File

@@ -0,0 +1,28 @@
//Tests dotted names (namespace, class names)
//It should emit namespace = A.B.C and type name = D
//For E.F, namespace = E, name = F
.assembly extern mscorlib
{
}
.assembly Output
{
}
.module Output
.namespace A.B {
.class public auto autochar sealed beforefieldinit C.D
extends [mscorlib]System.Object
{
}
}
.class public auto autochar sealed beforefieldinit E.F
extends [mscorlib]System.Object
{
}

View File

@@ -0,0 +1,34 @@
//Test for fields with same name but different types
.assembly extern mscorlib
{
.ver 1:0:5000:0
}
.assembly extern 'oneg'
{
}
.assembly 'field-dup'
{
.ver 0:0:0:0
}
.module 'field-dup.exe'
.class private auto ansi beforefieldinit boo`1 <T>
extends [mscorlib]System.Object
{
}
.class private auto ansi beforefieldinit foo`1 <T>
extends [mscorlib]System.Object
{
.field private !0 p
.field private class foo`1<!T> p
.field private class boo`1<!T> p
.field private class foo`1<int32> p
.field private class [oneg]outer/inner`1<!0> p
.field private class [oneg]outer/inner`1<int32> p
}

View File

@@ -0,0 +1,42 @@
//Test for fields with same name but different types
.assembly extern mscorlib
{
.ver 1:0:5000:0
}
.assembly extern one
{
.ver 0:0:0:0
}
.assembly extern two
{
.ver 0:0:0:0
}
.assembly 'field-dup'
{
.ver 0:0:0:0
}
.module 'field-dup.exe'
.class private auto ansi beforefieldinit test
extends [mscorlib]System.Object
{
.field private int32 i
.field private int32[] i
.field private class [mscorlib]System.Int32 i
.field private class [mscorlib]System.Int32[] i
.field private class [one]outer n
.field private class [one]outer[] n
.field private class [one]outer[][] n
.field private class [two]outer[][] n
.field private class [one]outer/inner i
.field private class [two]outer/inner i
.field private class [one]outer/inner [] i
.field private class [two]outer/inner [] i
}

69
mcs/ilasm/tests/gen-1.il Normal file
View File

@@ -0,0 +1,69 @@
//Tests generic method reference
.assembly extern mscorlib
{
.ver 2:0:0:0
}
.assembly pp
{
.ver 0:0:0:0
}
.class private auto ansi beforefieldinit 'A`1'<T>
extends [mscorlib]System.Object
{
.method public hidebysig static !T foo<X,Y>(!T _t,
!!X _x) cil managed
{
.maxstack 1
.locals init (!T V_0)
IL_0000: nop
IL_0001: ldarg.0
IL_0002: stloc.0
IL_0003: br.s IL_0005
IL_0005: ldloc.0
IL_0006: ret
}
.method public hidebysig specialname rtspecialname
instance void .ctor() cil managed
{
.maxstack 8
IL_0000: ldarg.0
IL_0001: call instance void [mscorlib]System.Object::.ctor()
IL_0006: ret
}
}
.class private auto ansi beforefieldinit 'B`1'<U>
extends [mscorlib]System.Object
{
.method public hidebysig static void bar<Z>() cil managed
{
// Code size 18 (0x12)
.maxstack 2
.locals init (!U V_0)
IL_0000: nop
IL_0001: ldloca.s V_0
IL_0003: initobj !U
IL_0009: ldloc.0
IL_000a: ldc.i4.5
IL_000b: call !0 class 'A`1'<!U>::foo<int32,!U>(!0,
!!Z)
IL_0010: pop
IL_0011: ret
} // end of method B`1::bar
.method public hidebysig specialname rtspecialname
instance void .ctor() cil managed
{
// Code size 7 (0x7)
.maxstack 8
IL_0000: ldarg.0
IL_0001: call instance void [mscorlib]System.Object::.ctor()
IL_0006: ret
} // end of method B`1::.ctor
}

View File

@@ -0,0 +1,62 @@
// Test that no duplicate TypeSpec entries are emitted
//
// Multiple instaces of generic type class g<T>, with the same
// argument (int32). Only one typespec should be emitted and shared by all these.
.assembly extern mscorlib
{
.ver 2:0:0:0
}
.assembly 'gen-array-1'
{
.custom instance void class [mscorlib]System.Runtime.CompilerServices.RuntimeCompatibilityAttribute::.ctor() = (
01 00 01 00 54 02 16 57 72 61 70 4E 6F 6E 45 78 // ....T..WrapNonEx
63 65 70 74 69 6F 6E 54 68 72 6F 77 73 01 ) // ceptionThrows.
.ver 0:0:0:0
}
.module arr.exe
.class private auto ansi beforefieldinit g`1<T>
extends [mscorlib]System.Object
{
.method public hidebysig specialname rtspecialname
instance default void .ctor () cil managed
{
.maxstack 8
IL_0000: ldarg.0
IL_0001: call instance void object::.ctor()
IL_0006: ret
}
}
.class private auto ansi beforefieldinit test
extends [mscorlib]System.Object
{
.method public static hidebysig
default void Main () cil managed
{
.entrypoint
.maxstack 3
.locals init (
/* Multiple generic instances with same argument */
class g`1<int32>[] V_0,
class g`1<int32>[][] V_1,
class g`1<int32> V_2,
class g`1<int32>[] V_3,
class g`1<class g`1<int32>> V_4,
class g`1<class g`1<int32>>[] V_5,
class g`1<class g`1<int32>>[][] V_6,
class g`1<class g`1<int32>[]>[][] V_7,
class g`1<class g`1<int32>[][]>[][] V_8)
IL_0000: ldc.i4.s 0x36
IL_0002: newarr class g`1<int32>
IL_0007: stloc.0
IL_0008: ldloc.0
IL_0009: ldc.i4.0
IL_000a: newobj instance void class g`1<int32>::.ctor()
IL_000f: stelem.ref
IL_0010: ret
}
}

View File

@@ -0,0 +1,52 @@
// Test that no duplicate TypeSpec entries are emitted
//
// Multiple instaces of generic type class [one]gen<T> from an *external* assembly, with the same
// argument (int32). Only one typespec should be emitted and shared by all these.
.assembly extern mscorlib
{
.ver 2:0:0:0
}
.assembly extern one
{
}
.assembly 'gen-array2'
{
.custom instance void class [mscorlib]System.Runtime.CompilerServices.RuntimeCompatibilityAttribute::.ctor() = (
01 00 01 00 54 02 16 57 72 61 70 4E 6F 6E 45 78 // ....T..WrapNonEx
63 65 70 74 69 6F 6E 54 68 72 6F 77 73 01 ) // ceptionThrows.
.ver 0:0:0:0
}
.module arr.exe
.class private auto ansi beforefieldinit test
extends [mscorlib]System.Object
{
.method public static hidebysig
default void Main () cil managed
{
.entrypoint
.maxstack 3
.locals init (
/* Multiple generic instances with same argument */
class [one]gen`1<int32>[] V_0,
class [one]gen`1<int32>[][] V_1,
class [one]gen`1<int32> V_2,
class [one]gen`1<int32>[] V_3,
class [one]gen`1<class [one]gen`1<int32>> V_4,
class [one]gen`1<class [one]gen`1<int32>>[] V_5,
class [one]gen`1<class [one]gen`1<int32>>[][] V_6,
class [one]gen`1<class [one]gen`1<int32>[]>[][] V_7,
class [one]gen`1<class [one]gen`1<int32>[][]>[][] V_8)
IL_0000: ldc.i4.s 0x36
IL_0002: newarr class [one]gen`1<int32>
IL_0007: stloc.0
IL_0008: ldloc.0
IL_0009: ldc.i4.0
IL_000a: newobj instance void class [one]gen`1<int32>::.ctor()
IL_000f: stelem.ref
IL_0010: ret
}
}

View File

@@ -0,0 +1,106 @@
// Test for constraints on generic parameters
.assembly extern mscorlib
{
.ver 2:0:0:0
}
.assembly 'const'
{
.custom instance void class [mscorlib]System.Runtime.CompilerServices.RuntimeCompatibilityAttribute::.ctor() = (
01 00 01 00 54 02 16 57 72 61 70 4E 6F 6E 45 78
63 65 70 74 69 6F 6E 54 68 72 6F 77 73 01 )
.ver 0:0:0:0
}
.module const.dll
.class interface private auto ansi abstract ITest1
{
}
.class interface private auto ansi abstract ITest
{
}
.class private auto ansi beforefieldinit bb
extends [mscorlib]System.Object
{
.method public hidebysig specialname rtspecialname
instance default void .ctor () cil managed
{
.maxstack 8
IL_0000: ldarg.0
IL_0001: call instance void object::.ctor()
IL_0006: ret
}
}
/* Constraints : .ctor, base class, interfaces */
.class private auto ansi beforefieldinit gen`1 <.ctor (class bb, class [mscorlib]System.Collections.Generic.ICollection`1<!T>, class [mscorlib]System.Collections.ICollection, class ITest1) T>
extends [mscorlib]System.Object
{
.method public hidebysig specialname rtspecialname
instance default void .ctor () cil managed
{
.maxstack 8
IL_0000: ldarg.0
IL_0001: call instance void object::.ctor()
IL_0006: ret
}
/* Constraints on a method's generic params */
.method public hidebysig
instance default void foo<.ctor (class [mscorlib]System.Collections.Generic.ICollection`1<!!0>) M> () cil managed
{
.maxstack 8
IL_0000: ret
}
}
/* Constraint : class */
.class private auto ansi beforefieldinit foo`1<class M>
extends [mscorlib]System.Object
{
.method public hidebysig specialname rtspecialname
instance default void .ctor () cil managed
{
.maxstack 8
IL_0000: ldarg.0
IL_0001: call instance void object::.ctor()
IL_0006: ret
}
}
/* Constraint : valuetype */
.class private auto ansi beforefieldinit bar`1<valuetype M>
extends [mscorlib]System.Object
{
.method public hidebysig specialname rtspecialname
instance default void .ctor () cil managed
{
.maxstack 8
IL_0000: ldarg.0
IL_0001: call instance void object::.ctor()
IL_0006: ret
}
}
/* Constraint : generic constraint */
.class private auto ansi beforefieldinit abc`1 <(class foo`1<class bb>) M>
extends [mscorlib]System.Object
{
.method public hidebysig specialname rtspecialname
instance default void .ctor () cil managed
{
.maxstack 8
IL_0000: ldarg.0
IL_0001: call instance void object::.ctor()
IL_0006: ret
}
}

View File

@@ -0,0 +1,25 @@
//Test for dotted-name for a generic type
.assembly extern mscorlib
{
.ver 2:0:0:0
}
.assembly 'dottedname'
{
}
.module dottedname.dll
.class private auto ansi beforefieldinit ns.gen`1<T>
extends [mscorlib]System.Object
{
}
.class private auto ansi beforefieldinit test
extends [mscorlib]System.Object
{
.field private class ns.gen`1<int32> g
}

View File

@@ -0,0 +1,51 @@
// Test for Ref to external generic types
.assembly extern mscorlib
{
.ver 2:0:0:0
}
.assembly extern one
{
.ver 0:0:0:0
}
.assembly 'gen-extern-type'
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.RuntimeCompatibilityAttribute::.ctor() = ( 01 00 01 00 54 02 16 57 72 61 70 4E 6F 6E 45 78
63 65 70 74 69 6F 6E 54 68 72 6F 77 73 01 )
.ver 0:0:0:0
}
.module use.exe
.class private auto ansi beforefieldinit test
extends [mscorlib]System.Object
{
.method public hidebysig specialname rtspecialname
instance void .ctor() cil managed
{
.maxstack 8
IL_0000: ldarg.0
IL_0001: call instance void [mscorlib]System.Object::.ctor()
IL_0006: ret
}
.method public hidebysig static void Main() cil managed
{
.entrypoint
.maxstack 3
.locals init (class [one]ns.gen_m`1<int32>[] V_0)
IL_0000: ldc.i4.5
IL_0001: newarr class [one]ns.gen_m`1<int32>
IL_0006: stloc.0
IL_0007: ldloc.0
IL_0008: ldc.i4.0
IL_0009: newobj instance void class [one]ns.gen_m`1<int32>::.ctor()
IL_000e: stelem.ref
IL_000f: ldstr "asd"
IL_0014: call void class [one]ns.gen_m`1<int32>::foo<string>(!!0)
IL_0019: ldc.i4.5
IL_001a: call void class [one]ns.gen_m`1<int32>::foo<int32,string>(!!0)
IL_001f: ret
}
}

View File

@@ -0,0 +1,79 @@
//Test generic field ref: should compile fine, but should give
//PEVerify error:
// f`1[T]::foo][offset 0x00000014] Field is not visible.
.assembly extern mscorlib
{
.ver 2:0:0:0
}
.assembly 'f2'
{
.ver 0:0:0:0
}
.module f2.dll
.class private auto ansi beforefieldinit 'f`1'<T>
extends [mscorlib]System.Object
{
.field public static !0 _t
.field public static !0[] _tarr
.field public static bool b
.method public hidebysig specialname rtspecialname
instance default void .ctor () cil managed
{
.maxstack 8
IL_0000: ldarg.0
IL_0001: call instance void object::.ctor()
IL_0006: ret
}
.method public static hidebysig
default void foo () cil managed
{
.maxstack 2
.locals init (
!T V_0)
IL_0000: ldloca.s 0
IL_0002: initobj !0
IL_0008: ldloc.0
IL_0009: stsfld !0 class 'f`1'<!0>::_t
IL_000e: ldc.i4.5
IL_000f: newarr !0
IL_0014: stsfld !!0[] class 'f`1'<!0>::_tarr
IL_0019: ldc.i4.1
IL_001a: stsfld bool class 'f`1'<!0>::b
IL_001f: ret
}
}
.class private auto ansi beforefieldinit g
extends [mscorlib]System.Object
{
.method public hidebysig specialname rtspecialname
instance default void .ctor () cil managed
{
.maxstack 8
IL_0000: ldarg.0
IL_0001: call instance void object::.ctor()
IL_0006: ret
}
.method private hidebysig
instance default void foo2 () cil managed
{
.maxstack 8
IL_0000: ldc.i4.4
IL_0001: stsfld !0 class 'f`1'<int32>::_t
IL_0006: ldc.i4.5
IL_0007: newarr [mscorlib]System.String
IL_000c: stsfld !0[] class 'f`1'<string>::_tarr
IL_0011: ldc.i4.1
IL_0012: stsfld bool class 'f`1'<string>::b
IL_0017: ret
}
}

Some files were not shown because too many files have changed in this diff Show More