2005-01-31 Zoltan Varga <vargaz@freemail.hu>
[mono.git] / mcs / ilasm / tests / generics-d.il
1 //
2 // Test a generic type type param field
3 //
4
5 .assembly extern mscorlib { }
6
7
8 .namespace Mono.ILASM.Tests {
9
10            .class public Set<T> extends [mscorlib]System.Object {
11
12                   .field public !0 val
13
14                 .method public instance void .ctor (!0 arg) {
15                         ldarg.0
16                         ldarg.1
17                         stfld !0 class Mono.ILASM.Tests.Set::val
18                         ret
19                 }
20
21                 .method public instance !0 access () {
22                         .locals init (!0)
23                         ldarg.0
24                         ldfld !0 class Mono.ILASM.Tests.Set::val
25                         // just to make sure locals work, too
26                         stloc.0
27                         ldloc.0
28                         ret
29                 }
30            }
31
32            .class public Driver extends [mscorlib]System.Object {
33
34                   .method public static void Main ()
35                   {
36                         .entrypoint
37                         .locals init ( class Mono.ILASM.Tests.Set<int32>,
38                                 class Mono.ILASM.Tests.Set<float64>)
39
40                         ldc.i4.4
41                         newobj instance void class Mono.ILASM.Tests.Set<int32>::.ctor (int32)
42                         stloc.0
43                         
44                         ldloc.0
45                         call instance int32 class Mono.ILASM.Tests.Set<int32>::access ()
46                         call void [mscorlib]System.Console::WriteLine (int32)
47
48                         ldc.r8 35.6
49                         newobj instance void class Mono.ILASM.Tests.Set<float64>::.ctor (float64)
50                         stloc.1
51                         
52                         ldloc.1
53                         call instance float64 class Mono.ILASM.Tests.Set<float64>::access ()
54                         call void [mscorlib]System.Console::WriteLine (float64)                        ret
55                   }
56
57            }
58 }
59