summaryrefslogtreecommitdiff
path: root/tests/src/JIT/Directed/throwbox/finally.il
blob: 2cb094d2ba1455e11ad74f698886be4527450a00 (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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

.assembly extern mscorlib { }
.assembly 'finally' { }
.namespace JitTest
{
  .class private auto ansi beforefieldinit Test
         extends [mscorlib]System.Object
  {
    .method private hidebysig static int32
            Main() cil managed
    {
      .entrypoint
      // Code size       115 (0x73)
      .maxstack  2
      .locals (bool V_0,
               bool V_1,
               bool V_2,
               int32 V_3)
      IL_0000:  ldc.i4.1
      IL_0001:  stloc.0
      IL_0002:  ldc.i4.0
      IL_0003:  stloc.1
      IL_0004:  ldc.i4.0
      IL_0005:  stloc.2
      .try
      {
        IL_0006:  ldstr      "before try...finally"
        IL_000b:  call       void [mscorlib]System.Console::WriteLine(string)
        .try
        {
          IL_0010:  ldstr      "inside try"
          IL_0015:  call       void [mscorlib]System.Console::WriteLine(string)
          IL_001a:  ldloc.0
          IL_001b:  brfalse.s  IL_0023

					ldc.r8 1.0
					box float64
          			throw

          IL_0023:  leave.s    IL_0032

        }  // end .try
        finally
        {
          IL_0025:  ldc.i4.1
          IL_0026:  stloc.1
          IL_0027:  ldstr      "inside finally"
          IL_002c:  call       void [mscorlib]System.Console::WriteLine(string)
          IL_0031:  endfinally
        }  // end handler
        IL_0032:  ldstr      "after try...finally"
        IL_0037:  call       void [mscorlib]System.Console::WriteLine(string)
        IL_003c:  leave.s    IL_004d
        
      }  // end .try
      catch [mscorlib]System.Double
      {
        		  unbox float64
        		  ldind.r8
        		  ldc.r8 1.0
        		  ceq
                  brfalse LEAVE
        		
        IL_003f:  ldstr      "inside catch"
        IL_0044:  call       void [mscorlib]System.Console::WriteLine(string)
        IL_0049:  ldc.i4.1
        IL_004a:  stloc.2
        LEAVE:
        IL_004b:  leave.s    IL_004d

      }  // end handler
      IL_004d:  ldloc.1
      IL_004e:  brfalse.s  IL_0062

      IL_0050:  ldloc.2
      IL_0051:  brfalse.s  IL_0062

      IL_0053:  ldstr      "Passed => 100"
      IL_0058:  call       void [mscorlib]System.Console::WriteLine(string)
      IL_005d:  ldc.i4.s   100
      IL_005f:  stloc.3
      IL_0060:  br.s       IL_0071

      IL_0062:  ldstr      "Failed => 101"
      IL_0067:  call       void [mscorlib]System.Console::WriteLine(string)
      IL_006c:  ldc.i4.s   101
      IL_006e:  stloc.3
      IL_006f:  br.s       IL_0071

      IL_0071:  ldloc.3
      IL_0072:  ret
    } // end of method Test::Main

    .method public hidebysig specialname rtspecialname 
            instance void .ctor() cil managed
    {
      // Code size       7 (0x7)
      .maxstack  8
      IL_0000:  ldarg.0
      IL_0001:  call       instance void [mscorlib]System.Object::.ctor()
      IL_0006:  ret
    } // end of method Test::.ctor

  } // end of class Test

} // end of namespace JitTest

//*********** DISASSEMBLY COMPLETE ***********************
// WARNING: Created Win32 resource file finally.res