2010-06-04 Jb Evain <jbevain@novell.com>
[mcs.git] / ilasm / tests / gen-array2.il
blob4528bb0f796e5431fa1fe848d7d4b774435dfca1
1 // Test that no duplicate TypeSpec entries are emitted 
2 //
3 // Multiple instaces of generic type class [one]gen<T> from an *external* assembly, with the same
4 // argument (int32). Only one typespec should be emitted and shared by all these.
6 .assembly extern mscorlib
8   .ver 2:0:0:0
10 .assembly extern one
13 .assembly 'gen-array2'
15   .custom instance void class [mscorlib]System.Runtime.CompilerServices.RuntimeCompatibilityAttribute::.ctor() =  (
16                 01 00 01 00 54 02 16 57 72 61 70 4E 6F 6E 45 78   // ....T..WrapNonEx
17                 63 65 70 74 69 6F 6E 54 68 72 6F 77 73 01       ) // ceptionThrows.
19   .ver  0:0:0:0
21 .module arr.exe
23   .class private auto ansi beforefieldinit test
24         extends [mscorlib]System.Object
25   {
26     .method public static  hidebysig 
27            default void Main ()  cil managed 
28     {
29         .entrypoint
30         .maxstack 3
31         .locals init (
32                 /* Multiple generic instances with same argument */
33                 class [one]gen`1<int32>[]       V_0,
34                 class [one]gen`1<int32>[][]     V_1,
35                 class [one]gen`1<int32> V_2,
36                 class [one]gen`1<int32>[]       V_3,
37                 class [one]gen`1<class [one]gen`1<int32>>       V_4,
38                 class [one]gen`1<class [one]gen`1<int32>>[]     V_5,
39                 class [one]gen`1<class [one]gen`1<int32>>[][]   V_6,
40                 class [one]gen`1<class [one]gen`1<int32>[]>[][] V_7,
41                 class [one]gen`1<class [one]gen`1<int32>[][]>[][]       V_8)
42         IL_0000:  ldc.i4.s 0x36
43         IL_0002:  newarr class [one]gen`1<int32>
44         IL_0007:  stloc.0 
45         IL_0008:  ldloc.0 
46         IL_0009:  ldc.i4.0 
47         IL_000a:  newobj instance void class [one]gen`1<int32>::.ctor()
48         IL_000f:  stelem.ref 
49         IL_0010:  ret 
50     }
52   }