summaryrefslogtreecommitdiff
path: root/tests/src/JIT/Methodical/switch/switch1.il
blob: a3a7a53365edc295fb25ef607d8d7333ba843823 (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
// 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.
//simple switch

.assembly extern legacy library mscorlib {}
.assembly 'switch1'
{                                            
  
  
}

.module 'switch1.exe'

.class public auto ansi Test
       extends ['mscorlib']System.Object
{
  .method private hidebysig static void  DoSwitch(int32 'value') il managed
  {
    .maxstack  2
    .locals (int32 V_0)
    IL_0000:  ldarg.0
    IL_0001:  stloc.0
    IL_0002:  ldloc.0
    IL_0003:  ldc.i4.1
    IL_0004:  sub
    IL_0005:  switch     ( 
                          IL_0014,
                          IL_0027)
    IL_0012:  br.s       IL_0033

    IL_0014:  ldc.i4.s   100
    IL_0016:  call       void ['mscorlib']System.Environment::set_ExitCode(int32)
    IL_001b:  ldstr      "Test passed"
    IL_0020:  call       void ['mscorlib']System.Console::WriteLine(class System.String)
    IL_0025:  br.s       IL_003f

    IL_0027:  ldstr      "Test failed"
    IL_002c:  call       void ['mscorlib']System.Console::WriteLine(class System.String)
    IL_0031:  br.s       IL_003f

    IL_0033:  ldstr      "Test failed"
    IL_0038:  call       void ['mscorlib']System.Console::WriteLine(class System.String)
    IL_003d:  br.s       IL_003f

    IL_003f:  ret
  } 

  .method public hidebysig static void Main() il managed
  {
    .entrypoint
    .maxstack  8
    IL_0000:  ldc.i4.1
    IL_0001:  call       void Test::DoSwitch(int32)
    IL_0006:  call       int32 ['mscorlib']System.Environment::get_ExitCode()
              call       void ['mscorlib']System.Environment::Exit(int32)
              ret
  } 

  
}