[jit] Fix the saving of the 'cfg->ret_var_set' flag when inlining, it was set to...
[mono.git] / mcs / ilasm / tests / test-seh-d.il
1 //
2 // Test catch and filter blocks
3 //
4 // Author(s):
5 //  Jackson Harper (Jackson@LatitudeGeo.com)
6 //
7 // (C) 2003 Jackson Harper, All rights reserved
8 //
9
10 .assembly extern mscorlib { }
11 .assembly 'test-seh-b' { }
12
13
14 .class public T {
15
16         .field private static int32 exc_not_thrown
17         .field private static int32 flt_1_caught
18         .field private static int32 flt_2_caught
19           
20         .method public static specialname void .cctor ()
21         {
22                 ldc.i4.0
23                 stsfld int32 T::exc_not_thrown
24
25                 ldc.i4.0
26                 stsfld int32 T::flt_1_caught
27
28                 ldc.i4 0
29                 stsfld int32 T::flt_2_caught
30
31                 ret
32         }
33
34         .method public static int32 Main ()
35         {
36                 .entrypoint
37
38                 .try {
39                         ldc.i4.0
40                         ldc.i4.0
41                         div
42
43                         ldc.i4.1
44                         stsfld int32 T::exc_not_thrown
45
46                         leave outer
47                 } filter {
48                         pop
49                         ldc.i4.0
50                         endfilter
51                 } {
52                         ldc.i4.1
53                         stsfld int32 T::flt_1_caught
54                         leave outer
55                 } filter {
56                         pop
57                         ldc.i4.1
58                         endfilter
59                 } {
60                         ldc.i4.1
61                         stsfld int32 T::flt_2_caught
62                         leave outer
63                 }
64            
65
66         outer:
67                 ldsfld int32 T::exc_not_thrown
68                 brtrue fail
69
70                 ldsfld int32 T::flt_1_caught
71                 brtrue fail
72
73                 ldsfld int32 T::flt_2_caught
74                 brfalse fail
75
76         pass:
77                 ldstr "PASS"
78                 call void [mscorlib]System.Console::WriteLine (string)
79                 ldc.i4.0
80                 ret
81
82         fail:
83                 ldstr "FAIL"
84                 call void [mscorlib]System.Console::WriteLine (string)
85                 ldc.i4.1
86                 ret
87
88         }
89
90 }
91                 
92