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

test-seh-d.il « tests « ilasm « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 0122b210b0fbc7c6a6524ada8356a7e39ab059f0 (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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
//
// Test catch and filter blocks
//
// Author(s):
//  Jackson Harper (Jackson@LatitudeGeo.com)
//
// (C) 2003 Jackson Harper, All rights reserved
//

.assembly extern mscorlib { }
.assembly 'test-seh-b' { }


.class public T {

        .field private static int32 exc_not_thrown
        .field private static int32 flt_1_caught
        .field private static int32 flt_2_caught
          
        .method public static specialname void .cctor ()
        {
                ldc.i4.0
                stsfld int32 T::exc_not_thrown

                ldc.i4.0
                stsfld int32 T::flt_1_caught

                ldc.i4 0
                stsfld int32 T::flt_2_caught

                ret
        }

        .method public static int32 Main ()
        {
                .entrypoint

                .try {
                        ldc.i4.0
                        ldc.i4.0
                        div

                        ldc.i4.1
                        stsfld int32 T::exc_not_thrown

                        leave outer
                } filter {
                        pop
                        ldc.i4.0
                        endfilter
                } {
                        ldc.i4.1
                        stsfld int32 T::flt_1_caught
                        leave outer
                } filter {
                        pop
                        ldc.i4.1
                        endfilter
                } {
                        ldc.i4.1
                        stsfld int32 T::flt_2_caught
                        leave outer
                }
           

        outer:
                ldsfld int32 T::exc_not_thrown
                brtrue fail

                ldsfld int32 T::flt_1_caught
                brtrue fail

                ldsfld int32 T::flt_2_caught
                brfalse fail

        pass:
                ldstr "PASS"
                call void [mscorlib]System.Console::WriteLine (string)
                ldc.i4.0
                ret

        fail:
                ldstr "FAIL"
                call void [mscorlib]System.Console::WriteLine (string)
                ldc.i4.1
                ret

        }

}