flush
[mcs.git] / ilasm / tests / gen-array1.il
blob51dec68d0146656a7099c8aad2abe398a94ff196
1 // Test that no duplicate TypeSpec entries are emitted 
2 //
3 // Multiple instaces of generic type class g<T>, 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 'gen-array-1'
12   .custom instance void class [mscorlib]System.Runtime.CompilerServices.RuntimeCompatibilityAttribute::.ctor() =  (
13                 01 00 01 00 54 02 16 57 72 61 70 4E 6F 6E 45 78   // ....T..WrapNonEx
14                 63 65 70 74 69 6F 6E 54 68 72 6F 77 73 01       ) // ceptionThrows.
16   .ver  0:0:0:0
18 .module arr.exe
20   .class private auto ansi beforefieldinit g`1<T>
21         extends [mscorlib]System.Object
22   {
23     .method public hidebysig  specialname  rtspecialname 
24            instance default void .ctor ()  cil managed 
25     {
26         .maxstack 8
27         IL_0000:  ldarg.0 
28         IL_0001:  call instance void object::.ctor()
29         IL_0006:  ret 
30     }
31   }
33   .class private auto ansi beforefieldinit test
34         extends [mscorlib]System.Object
35   {
36     .method public static  hidebysig 
37            default void Main ()  cil managed 
38     {
39         .entrypoint
40         .maxstack 3
41         .locals init (
42                 /* Multiple generic instances with same argument */
43                 class g`1<int32>[]      V_0,
44                 class g`1<int32>[][]    V_1,
45                 class g`1<int32>        V_2,
46                 class g`1<int32>[]      V_3,
47                 class g`1<class g`1<int32>>     V_4,
48                 class g`1<class g`1<int32>>[]   V_5,
49                 class g`1<class g`1<int32>>[][] V_6,
50                 class g`1<class g`1<int32>[]>[][]       V_7,
51                 class g`1<class g`1<int32>[][]>[][]     V_8)
52         IL_0000:  ldc.i4.s 0x36
53         IL_0002:  newarr class g`1<int32>
54         IL_0007:  stloc.0 
55         IL_0008:  ldloc.0 
56         IL_0009:  ldc.i4.0 
57         IL_000a:  newobj instance void class g`1<int32>::.ctor()
58         IL_000f:  stelem.ref 
59         IL_0010:  ret 
60     }
62   }