Welcome to mirror list, hosted at ThFree Co, Russian Federation.

test-module-cattr.il « tests « ilasm « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 8b77c200520904e87a438db85b3816f0855ab526 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// Test for custom attributes on this .module

.assembly extern mscorlib
{
  .ver 1:0:5000:0
}
.assembly extern System
{
  .ver 1:0:5000:0
}
.assembly 'test-module-cattr'
{
  .ver  0:0:0:0
}
.module 'test-module-cattr.exe'

.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..


  .class private auto ansi beforefieldinit test
  	extends [mscorlib]System.Object
  {

    .method public hidebysig  specialname  rtspecialname 
           instance default void .ctor ()  cil managed 
    {
	.maxstack 8
	IL_0000:  ldarg.0 
	IL_0001:  call instance void object::.ctor()
	IL_0006:  ret 
    }

    .method public static  hidebysig 
           default void Main ()  cil managed 
    {
	.entrypoint
	.maxstack 7
	.locals init (
		class [mscorlib]System.Reflection.Module	V_0)
	IL_0000:  ldtoken test
	IL_0005:  call class [mscorlib]System.Type class [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
	IL_000a:  callvirt instance class [mscorlib]System.Reflection.Module class [mscorlib]System.Type::get_Module()
	IL_000f:  stloc.0 
	IL_0010:  ldloc.0 
	IL_0011:  call class [mscorlib]System.Attribute[] class [mscorlib]System.Attribute::GetCustomAttributes(class [mscorlib]System.Reflection.Module)
	IL_0016:  ldlen 
	IL_0017:  conv.i4 
	IL_0018:  ldc.i4.1 
	IL_0019:  bne.un IL_002d

	IL_001e:  ldstr "OK"
	IL_0023:  call void class [mscorlib]System.Console::WriteLine(string)
	IL_0028:  br IL_0037

	IL_002d:  ldstr "Error"
	IL_0032:  call void class [mscorlib]System.Console::WriteLine(string)
	IL_0037:  ret 
    }

  }