PageRenderTime 17ms CodeModel.GetById 10ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 1ms

/ICSharpCode.Decompiler/Tests/StackTests/StackTests.il

http://github.com/icsharpcode/ILSpy
SKILL | 132 lines | 107 code | 25 blank | 0 comment | 1 complexity | e7531343f6fd328078dd663d5d067f9a MD5 | raw file
  1.assembly extern mscorlib
  2{
  3  .publickeytoken = (B7 7A 5C 56 19 34 E0 89 )
  4  .ver 4:0:0:0
  5}
  6.assembly StackTests
  7{
  8  .hash algorithm 0x00008004
  9  .ver 1:0:4059:39717
 10}
 11.module StackTests.exe
 12.imagebase 0x00400000
 13.file alignment 0x00000200
 14.stackreserve 0x00100000
 15.subsystem 0x0003       // WINDOWS_CUI
 16.corflags 0x00000003    //  ILONLY 32BITREQUIRED
 17
 18.class private auto ansi beforefieldinit StackTests.Program extends [mscorlib]System.Object
 19{
 20  .method public hidebysig static void  Main(string[] args) cil managed
 21  {
 22    .entrypoint
 23    .maxstack  8
 24	
 25	ldc.i4.0
 26	call string StackTests.Program::Test1(bool cond)
 27	call void [mscorlib]System.Console::WriteLine(string) // false
 28	
 29	ldc.i4.1
 30	call string StackTests.Program::Test1(bool cond)
 31	call void [mscorlib]System.Console::WriteLine(string) // true
 32	
 33	ldc.i4.0
 34	ldc.i4.0
 35	ldc.i4.0
 36	call int32 StackTests.Program::Test2(int32 switch1, int32 br1, int32 br2)
 37	call void [mscorlib]System.Console::WriteLine(int32)  // 11
 38	
 39	ldc.i4.0
 40	ldc.i4.1
 41	ldc.i4.0
 42	call int32 StackTests.Program::Test2(int32 switch1, int32 br1, int32 br2)
 43	call void [mscorlib]System.Console::WriteLine(int32)  // 21
 44	
 45	ldc.i4.1
 46	ldc.i4.1
 47	ldc.i4.1
 48	call int32 StackTests.Program::Test2(int32 switch1, int32 br1, int32 br2)
 49	call void [mscorlib]System.Console::WriteLine(int32)  // 32
 50	
 51	ldc.i4.2
 52	ldc.i4.1
 53	ldc.i4.0
 54	call int32 StackTests.Program::Test2(int32 switch1, int32 br1, int32 br2)
 55	call void [mscorlib]System.Console::WriteLine(int32)  // 23
 56	
 57	ret
 58  }
 59
 60  .method public hidebysig static string Test1(bool cond) cil managed
 61  {
 62	ldarg.0
 63	brtrue TRUE
 64	
 65	FALSE:
 66	ldstr "false"
 67	br EXIT
 68		
 69	TRUE:
 70	ldstr "true"
 71		
 72	EXIT:
 73	ret
 74  }
 75
 76  .method public hidebysig static int32 Test2(int32 switch1, int32 br1, int32 br2) cil managed
 77  {
 78    ldarg.0
 79    switch (ENTRY1, ENTRY2, ENTRY3)
 80	ldc.i4.0
 81    ret
 82
 83    ENTRY1:
 84	ldc.i4.1
 85    br BRANCH1
 86
 87    ENTRY2:
 88	ldc.i4.2
 89    br BRANCH1
 90
 91    ENTRY3:
 92	ldc.i4.3
 93    br BRANCH2
 94	
 95	BRANCH1:
 96	ldarg.1
 97	brtrue BRANCH2
 98	
 99	EXIT1:
100	ldc.i4 10
101	add
102	ret
103	
104	BRANCH2:
105	ldarg.2
106	brtrue.s EXIT3
107	
108	EXIT2:
109	ldc.i4 20
110	add
111	ret
112	
113	EXIT3:
114	ldc.i4 30
115	add
116	ret
117  }
118
119  .method public hidebysig specialname rtspecialname 
120          instance void  .ctor() cil managed
121  {
122    // Code size       7 (0x7)
123    .maxstack  8
124    IL_0000:  ldarg.0
125    IL_0001:  call       instance void [mscorlib]System.Object::.ctor()
126    IL_0006:  ret
127  } // end of method Program::.ctor
128
129} // end of class StackTests.Program
130
131
132// =============================================================