forked from dotnet/runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeadcodeincatch.il
More file actions
222 lines (191 loc) · 6.82 KB
/
Copy pathdeadcodeincatch.il
File metadata and controls
222 lines (191 loc) · 6.82 KB
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
.assembly extern mscorlib
{
}
.assembly extern System.Console
{
.publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A )
.ver 4:0:0:0
}
.assembly extern eh_common {}
.assembly 'deadcodeincatch'
{
// --- The following custom attribute is added automatically, do not uncomment -------
// .custom instance void [mscorlib]System.Diagnostics.DebuggableAttribute::.ctor(bool,
// bool) = ( 01 00 00 01 00 00 )
.hash algorithm 0x00008004
.ver 0:0:0:0
}
.assembly extern xunit.core {}
// MVID: {3B8B6D1B-A317-4591-BD66-1D1000E3767F}
.imagebase 0x00400000
.subsystem 0x00000003
.file alignment 512
.corflags 0x00000001
// Image base: 0x03010000
//
// ============== CLASS STRUCTURE DECLARATION ==================
//
.namespace hello
{
.class private auto ansi beforefieldinit Class1
extends [mscorlib]System.Object
{
.field private static class [eh_common]TestUtil.TestLog testLog
.method private hidebysig specialname rtspecialname static void .cctor() cil managed
{
.maxstack 3
.locals init (class [mscorlib]System.IO.StringWriter expectedOut)
newobj instance void [mscorlib]System.IO.StringWriter::.ctor()
stloc.s expectedOut
ldloc.s expectedOut
ldstr "In try"
callvirt instance void [mscorlib]System.IO.TextWriter::WriteLine(string)
ldloc.s expectedOut
ldstr "In catch"
callvirt instance void [mscorlib]System.IO.TextWriter::WriteLine(string)
ldloc.s expectedOut
ldstr "hello"
callvirt instance void [mscorlib]System.IO.TextWriter::WriteLine(string)
ldloc.s expectedOut
ldstr "In finally"
callvirt instance void [mscorlib]System.IO.TextWriter::WriteLine(string)
ldloc.s expectedOut
ldstr "Pass"
callvirt instance void [mscorlib]System.IO.TextWriter::WriteLine(string)
ldloc.s expectedOut
newobj instance void [eh_common]TestUtil.TestLog::.ctor(object)
stsfld class [eh_common]TestUtil.TestLog hello.Class1::testLog
ret
} // end of method Class1::.cctor
} // end of class Class1
} // end of namespace hello
// =============================================================
// =============== GLOBAL FIELDS AND METHODS ===================
// =============================================================
// =============== CLASS MEMBERS DECLARATION ===================
// note that class flags, 'extends' and 'implements' clauses
// are provided here for information only
.namespace hello
{
.class private auto ansi beforefieldinit Class1
extends [mscorlib]System.Object
{
.method public hidebysig static void
inTry() cil managed
{
// Code size 11 (0xb)
.maxstack 1
IL_0000: ldstr "In try"
IL_0005: call void [System.Console]System.Console::WriteLine(string)
IL_000a: ret
} // end of method Class1::inTry
.method public hidebysig static void
inCatch() cil managed
{
// Code size 11 (0xb)
.maxstack 1
IL_0000: ldstr "In catch"
IL_0005: call void [System.Console]System.Console::WriteLine(string)
IL_000a: ret
} // end of method Class1::inCatch
.method public hidebysig static void
inFinally() cil managed
{
// Code size 1 (0x1)
.maxstack 0
IL_0000: ret
} // end of method Class1::inFinally
.method public hidebysig static int32
Main() cil managed
{
.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = (
01 00 00 00
)
.entrypoint
.maxstack 1
ldstr "hello"
call int32 hello.Class1::Run(string)
ret
}
.method public hidebysig static int32
Run(string arg) cil managed
{
// Code size 74 (0x4a)
.maxstack 2
.locals init (string V_0,
class [mscorlib]System.Exception V_1,
string V_2,
int32 V_3)
starttest:
// Start recording
ldsfld class [eh_common]TestUtil.TestLog hello.Class1::testLog
callvirt instance void [eh_common]TestUtil.TestLog::StartRecording()
ldarg.0
stloc.0
.try
{
call void hello.Class1::inTry()
newobj instance void [mscorlib]System.Exception::.ctor()
throw
leave.s done
} // end .try
catch [mscorlib]System.Exception
{
stloc.1
.try
{
ldstr "Hello"
ldloc.0
call string [mscorlib]System.String::Concat(string,
string)
stloc.2
call void hello.Class1::inCatch()
ldloc.0
call void [System.Console]System.Console::WriteLine(string)
br.s donetry
ldloc.0
callvirt instance int32 [mscorlib]System.String::get_Length()
ldc.i4.2
blt.s donetry
ldloc.2
call void [System.Console]System.Console::WriteLine(string)
donetry:
leave.s donecatch
} finally {
ldstr "In finally"
call void [System.Console]System.Console::WriteLine(string)
endfinally
}
donecatch:
leave.s doneok
} // end handler
doneok:
ldstr "Pass"
call void [System.Console]System.Console::WriteLine(string)
// stop recoding
ldsfld class [eh_common]TestUtil.TestLog hello.Class1::testLog
callvirt instance void [eh_common]TestUtil.TestLog::StopRecording()
// verify output
ldsfld class [eh_common]TestUtil.TestLog hello.Class1::testLog
callvirt instance int32 [eh_common]TestUtil.TestLog::VerifyOutput()
stloc.3
done:
ldloc.3
ret
} // end of method Class1::Main
.method public hidebysig specialname rtspecialname
instance void .ctor() cil managed
{
// Code size 7 (0x7)
.maxstack 1
IL_0000: ldarg.0
IL_0001: call instance void [mscorlib]System.Object::.ctor()
IL_0006: ret
} // end of method Class1::.ctor
} // end of class Class1
// =============================================================
} // end of namespace hello
//*********** DISASSEMBLY COMPLETE ***********************
// WARNING: Created Win32 resource file deadcodeincatch.res