2010-06-03 Jb Evain <jbevain@novell.com>
[mcs.git] / ilasm / tests / test-module-cattr.il
blob8b77c200520904e87a438db85b3816f0855ab526
1 // Test for custom attributes on this .module
3 .assembly extern mscorlib
5   .ver 1:0:5000:0
7 .assembly extern System
9   .ver 1:0:5000:0
11 .assembly 'test-module-cattr'
13   .ver  0:0:0:0
15 .module 'test-module-cattr.exe'
17 .custom instance void class [System]System.ComponentModel.DescriptionAttribute::.ctor(string) =  (01 00 0A 53 6F 6D 65 4D 6F 64 75 6C 65 00 00 ) // ...SomeModule..
20   .class private auto ansi beforefieldinit test
21         extends [mscorlib]System.Object
22   {
24     .method public hidebysig  specialname  rtspecialname 
25            instance default void .ctor ()  cil managed 
26     {
27         .maxstack 8
28         IL_0000:  ldarg.0 
29         IL_0001:  call instance void object::.ctor()
30         IL_0006:  ret 
31     }
33     .method public static  hidebysig 
34            default void Main ()  cil managed 
35     {
36         .entrypoint
37         .maxstack 7
38         .locals init (
39                 class [mscorlib]System.Reflection.Module        V_0)
40         IL_0000:  ldtoken test
41         IL_0005:  call class [mscorlib]System.Type class [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
42         IL_000a:  callvirt instance class [mscorlib]System.Reflection.Module class [mscorlib]System.Type::get_Module()
43         IL_000f:  stloc.0 
44         IL_0010:  ldloc.0 
45         IL_0011:  call class [mscorlib]System.Attribute[] class [mscorlib]System.Attribute::GetCustomAttributes(class [mscorlib]System.Reflection.Module)
46         IL_0016:  ldlen 
47         IL_0017:  conv.i4 
48         IL_0018:  ldc.i4.1 
49         IL_0019:  bne.un IL_002d
51         IL_001e:  ldstr "OK"
52         IL_0023:  call void class [mscorlib]System.Console::WriteLine(string)
53         IL_0028:  br IL_0037
55         IL_002d:  ldstr "Error"
56         IL_0032:  call void class [mscorlib]System.Console::WriteLine(string)
57         IL_0037:  ret 
58     }
60   }