diff options
Diffstat (limited to 'tests/src/JIT/Methodical/eh/rethrow/rethrowinfinallyinsidecatch.il')
-rw-r--r-- | tests/src/JIT/Methodical/eh/rethrow/rethrowinfinallyinsidecatch.il | 160 |
1 files changed, 160 insertions, 0 deletions
diff --git a/tests/src/JIT/Methodical/eh/rethrow/rethrowinfinallyinsidecatch.il b/tests/src/JIT/Methodical/eh/rethrow/rethrowinfinallyinsidecatch.il new file mode 100644 index 0000000000..b7eb3698c1 --- /dev/null +++ b/tests/src/JIT/Methodical/eh/rethrow/rethrowinfinallyinsidecatch.il @@ -0,0 +1,160 @@ + +.assembly extern System.Console +{ + .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) + .ver 4:0:0:0 +} +.assembly extern mscorlib {} +.assembly extern common {} +.assembly rethrowinfinallyaftercatch {} + +.module rethrowinfinallyaftercatch.exe + +.namespace Test +{ + .class private auto ansi beforefieldinit Class1 + extends [mscorlib]System.Object + { + .field private static class [common]TestUtil.TestLog testLog + .method private hidebysig specialname rtspecialname static void .cctor() cil managed + { + .maxstack 2 + .locals init (class [mscorlib]System.IO.StringWriter expectedOut) + newobj instance void [mscorlib]System.IO.StringWriter::.ctor() + stloc.s expectedOut + + ldloc.s expectedOut + ldstr "try" + callvirt instance void [mscorlib]System.IO.TextWriter::WriteLine(string) + ldloc.s expectedOut + ldstr "\ttry - throwing outer exception" + callvirt instance void [mscorlib]System.IO.TextWriter::WriteLine(string) + ldloc.s expectedOut + ldstr "\tcatch - Outer Exception" + callvirt instance void [mscorlib]System.IO.TextWriter::WriteLine(string) + ldloc.s expectedOut + ldstr "\t\ttry - throwing inner exception" + callvirt instance void [mscorlib]System.IO.TextWriter::WriteLine(string) + ldloc.s expectedOut + ldstr "\t\tcatch - Inner Exception" + callvirt instance void [mscorlib]System.IO.TextWriter::WriteLine(string) + ldloc.s expectedOut + ldstr "\t\tfinally - Rethrowing Outer Exception" + callvirt instance void [mscorlib]System.IO.TextWriter::WriteLine(string) + ldloc.s expectedOut + ldstr "catch - Outer Exception" + callvirt instance void [mscorlib]System.IO.TextWriter::WriteLine(string) + + ldloc.s expectedOut + newobj instance void [common]TestUtil.TestLog::.ctor(object) + stsfld class [common]TestUtil.TestLog Test.Class1::testLog + ret + } + + .method public hidebysig static int32 + Main(string[] args) cil managed + { + .entrypoint + .maxstack 3 + .locals init (class [mscorlib]System.Exception eo, + class [mscorlib]System.Exception ei, + class [mscorlib]System.Exception e, + int32 V_3) + + ldsfld class [common]TestUtil.TestLog Test.Class1::testLog + callvirt instance void [common]TestUtil.TestLog::StartRecording() + + .try + { + ldstr "try" + call void [System.Console]System.Console::WriteLine(string) + .try + { + ldstr "\ttry - throwing outer exception" + call void [System.Console]System.Console::WriteLine(string) + ldstr "Outer Exception" + newobj instance void [mscorlib]System.Exception::.ctor(string) + throw + + } + catch [mscorlib]System.Exception + { + stloc.0 + ldstr "\tcatch - " + ldloc.0 + callvirt instance string [mscorlib]System.Exception::get_Message() + call string [mscorlib]System.String::Concat(string, + string) + call void [System.Console]System.Console::WriteLine(string) + .try + { + .try + { + ldstr "\t\ttry - throwing inner exception" + call void [System.Console]System.Console::WriteLine(string) + ldstr "Inner Exception" + newobj instance void [mscorlib]System.Exception::.ctor(string) + throw + + } + catch [mscorlib]System.Exception + { + stloc.1 + ldstr "\t\tcatch - " + ldloc.1 + callvirt instance string [mscorlib]System.Exception::get_Message() + call string [mscorlib]System.String::Concat(string, + string) + call void [System.Console]System.Console::WriteLine(string) + leave.s L1 + + } + L1: + leave.s L2 + + } + finally + { + ldstr "\t\tfinally - Rethrowing Outer Exception" + call void [System.Console]System.Console::WriteLine(string) + rethrow + } + L2: + br.s L2 + + } + } + catch [mscorlib]System.Exception + { + stloc.2 + ldstr "catch - " + ldloc.2 + callvirt instance string [mscorlib]System.Exception::get_Message() + call string [mscorlib]System.String::Concat(string, + string) + call void [System.Console]System.Console::WriteLine(string) + leave.s L3 + + } + L3: + ldsfld class [common]TestUtil.TestLog Test.Class1::testLog + callvirt instance void [common]TestUtil.TestLog::StopRecording() + + ldsfld class [common]TestUtil.TestLog Test.Class1::testLog + callvirt instance int32 [common]TestUtil.TestLog::VerifyOutput() + + ret + } + + .method public hidebysig specialname rtspecialname + instance void .ctor() cil managed + { + .maxstack 1 + IL_0000: ldarg.0 + IL_0001: call instance void [mscorlib]System.Object::.ctor() + IL_0006: ret + } + + } + +} |