summaryrefslogtreecommitdiff
path: root/tests/src/JIT/Methodical/casts/SEH/castclass_catch_neg.il
blob: 2179364b7696fc9337f96feff54f1db0a256a75c (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
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

// castclass_catch_neg.il
.assembly extern mscorlib { }
.assembly extern System.Console
{
  .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A )
  .ver 4:0:0:0
}
.assembly castclass_catch_neg { }
.namespace JitTest
{
  .class private auto ansi beforefieldinit Test
         extends [mscorlib]System.Object
  {
    .method private hidebysig static int32
            Main() cil managed
    {
      .entrypoint
      .maxstack  3
      .locals (int32 V_0,
               int32 V_1,
               class [mscorlib]System.Exception V_2,
               int32 V_4)
      .try
      {
        .try
        {
          IL_0000:  ldc.i4.5
          IL_0001:  stloc.0
          IL_0002:  ldloc.0
          IL_0003:  stloc.1
          IL_0004:  ldloc.0
          IL_0005:  ldloc.1
          IL_0006:  ldloc.0
          IL_0007:  sub
          IL_0008:  div
          IL_0009:  call       void [System.Console]System.Console::WriteLine(int32)
          IL_000e:  ldstr      "failed (1)"
          IL_0013:  call       void [System.Console]System.Console::WriteLine(string)
          IL_0018:  ldc.i4.s   101
          IL_001a:  stloc.s    V_4
          IL_001c:  leave.s    IL_004d
        }
        catch [mscorlib]System.Exception 
        {
          IL_0020:  castclass  [mscorlib]System.ArgumentException
          IL_0027:  call       void [System.Console]System.Console::WriteLine(object)
          IL_002c:  ldstr      "failed (2)"
          IL_0031:  call       void [System.Console]System.Console::WriteLine(string)
          IL_0036:  ldc.i4.s   102
          IL_0038:  stloc.s    V_4
          IL_003a:  leave.s    IL_004d
        }
      }
      catch [mscorlib]System.InvalidCastException 
      {
        IL_003c:  pop
        IL_003d:  ldstr      "*** TEST PASSED ***"
        IL_0042:  call       void [System.Console]System.Console::WriteLine(string)
        IL_0047:  ldc.i4.s   100
        IL_0049:  stloc.s    V_4
        IL_004b:  leave.s    IL_004d
      }
      IL_004d:  ldloc.s    V_4
      IL_004f:  ret
    }
    .method public hidebysig specialname rtspecialname 
            instance void .ctor() cil managed
    {
      .maxstack  8
      IL_0000:  ldarg.0
      IL_0001:  call       instance void [mscorlib]System.Object::.ctor()
      IL_0006:  ret
    }
  }
}