Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mono / tests / filter-bug.il
1 .assembly extern mscorlib
2 {
3   .publickeytoken = (B7 7A 5C 56 19 34 E0 89 )                         // .z\V.4..
4   .ver 2:0:0:0
5 }
6 .assembly bug
7 {
8   .hash algorithm 0x00008004
9   .ver 0:0:0:0
10 }
11 .module 'bug-module'
12 .imagebase 0x00400000
13 .file alignment 0x00000200
14 .stackreserve 0x00100000
15 .subsystem 0x0003       // WINDOWS_CUI
16 .corflags 0x00000001    //  ILONLY
17
18
19 // =============== CLASS MEMBERS DECLARATION ===================
20
21 .class public auto ansi 
22 beforefieldinit '<PrivateImplementationDetails$bug>'
23        extends [mscorlib]System.Object
24 {
25 } // end of class '<PrivateImplementationDetails$bug>'
26
27 .class public auto ansi beforefieldinit Bug
28        extends [mscorlib]System.Object
29 {
30   .method public static char  get(string str,int32 i) cil managed
31   {
32     // Code size       61 (0x3d)
33     .maxstack  4
34     .locals init (char V_0,
35              class [mscorlib]System.Exception V_1,
36              class [mscorlib]System.Exception V_2)
37     IL_0000:  ldarg.0
38     IL_0001:  ldarg.1
39     IL_0002:  
40     
41                call       instance char [mscorlib]System.String::get_Chars (int32)
42               // Strangely this doesn't cause a crash
43               //call       instance int32 [mscorlib]System.String::IndexOf (char)
44               
45               stloc.0
46
47     IL_0008:  leave.s    IL_003b
48     IL_000a:  pop 
49               ldc.i4.1  
50               endfilter
51     
52     
53     IL_001e:  throw
54     IL_003b:  ldloc.0
55     .try IL_0000 to IL_000a filter IL_000a handler IL_001e to IL_003b
56     IL_003c:  ret
57   } // end of method Bug::get
58
59   .method public static bool  capture(int32 i) cil managed
60   {
61     // Code size       16 (0x10)
62     .maxstack  4
63     IL_0000:  ldstr      "Testing\n"
64     IL_0005:  ldarg.0
65     IL_0006:  call       char Bug::get(string,int32)
66     IL_000b:  ldc.i4.s   37
67     IL_000d:  ceq
68     IL_000f:  ret
69   } // end of method Bug::capture
70
71 } // end of class Bug
72
73 .class public auto ansi beforefieldinit '<StartupCode>'.Bug
74        extends [mscorlib]System.Object
75 {
76   .method public static void  _main() cil managed
77   {
78     .entrypoint
79     // Code size       8 (0x8)
80     .maxstack  3
81     .locals init (bool V_0)
82     IL_0000:  ldc.i4.0
83     IL_0001:  call       bool Bug::capture(int32)
84     IL_0006:  stloc.0
85     IL_0007:  ret
86   } // end of method Bug::_main
87
88 } // end of class '<StartupCode>'.Bug
89
90