Merge pull request #5428 from kumpera/wasm-support-p2
[mono.git] / mono / tests / invalid_generic_instantiation.il
1 .assembly extern mscorlib
2 {
3   .ver 4:0:0:0
4   .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4..
5 }
6 .assembly 'repro'
7 {
8   .custom instance void class [mscorlib]System.Runtime.CompilerServices.RuntimeCompatibilityAttribute::'.ctor'() =  (
9                 01 00 01 00 54 02 16 57 72 61 70 4E 6F 6E 45 78   // ....T..WrapNonEx
10                 63 65 70 74 69 6F 6E 54 68 72 6F 77 73 01       ) // ceptionThrows.
11
12   .hash algorithm 0x00008004
13   .ver  0:0:0:0
14 }
15 .module repro.exe // GUID = {5C01F6E6-77DE-4AB1-AD74-6AA56EAA8CD8}
16
17
18   .class private auto ansi beforefieldinit Foo`1<T>
19         extends [mscorlib]System.Object
20   {
21     .field  private  !0 t
22
23     // method line 1
24     .method public hidebysig specialname rtspecialname 
25            instance default void '.ctor' ()  cil managed 
26     {
27         // Method begins at RVA 0x20ec
28         // Code size 22 (0x16)
29         .maxstack 4
30         .locals init (
31                 !T      V_0)
32         IL_0000:  ldarg.0 
33         IL_0001:  call instance void object::'.ctor'()
34         IL_0006:  ldarg.0 
35         IL_0007:  ldloca.s 0
36         IL_0009:  initobj !0
37         IL_000f:  ldloc.0 
38         IL_0010:  stfld !0 class Foo`1<!0>::t
39         IL_0015:  ret 
40     } // end of method Foo`1::.ctor
41
42   } // end of class Foo`1
43
44   .class private auto ansi beforefieldinit Program
45         extends [mscorlib]System.Object
46   {
47
48     // method line 2
49     .method public hidebysig specialname rtspecialname 
50            instance default void '.ctor' ()  cil managed 
51     {
52         // Method begins at RVA 0x2110
53         // Code size 7 (0x7)
54         .maxstack 8
55         IL_0000:  ldarg.0 
56         IL_0001:  call instance void object::'.ctor'()
57         IL_0006:  ret 
58     } // end of method Program::.ctor
59
60     // method line 3
61     .method private static hidebysig 
62            default void CreateInvalidInstantiation ()  cil managed noinlining 
63     {
64         // Method begins at RVA 0x2118
65         // Code size 7 (0x7)
66         .maxstack 8
67         IL_0000:  newobj instance void class Foo`1<void>::'.ctor'()
68         IL_0005:  pop 
69         IL_0006:  ret 
70     } // end of method Program::CreateInvalidInstantiation
71
72     // method line 4
73     .method private static hidebysig 
74            default int32 Main ()  cil managed 
75     {
76         // Method begins at RVA 0x2120
77         .entrypoint
78         // Code size 52 (0x34)
79         .maxstack 3
80         .locals init (
81                 int32   V_0)
82         .try { // 0
83           IL_0000:  call void class Program::CreateInvalidInstantiation()
84           IL_0005:  ldstr "NO EXCEPTION"
85           IL_000a:  call void class [mscorlib]System.Console::WriteLine(string)
86           IL_000f:  ldc.i4.1 
87           IL_0010:  stloc.0 
88           IL_0011:  leave IL_0032
89
90           IL_0016:  leave IL_0032
91
92         } // end .try 0
93         catch class [mscorlib]System.TypeLoadException { // 0
94           IL_001b:  pop 
95           IL_001c:  ldstr "OK"
96           IL_0021:  call void class [mscorlib]System.Console::WriteLine(string)
97           IL_0026:  ldc.i4.0 
98           IL_0027:  stloc.0 
99           IL_0028:  leave IL_0032
100
101           IL_002d:  leave IL_0032
102
103         } // end handler 0
104         IL_0032:  ldloc.0 
105         IL_0033:  ret 
106     } // end of method Program::Main
107
108   } // end of class Program
109