summaryrefslogtreecommitdiff
path: root/tests/src/JIT/Methodical/eh/deadcode/deadtrycatch.il
diff options
context:
space:
mode:
Diffstat (limited to 'tests/src/JIT/Methodical/eh/deadcode/deadtrycatch.il')
-rw-r--r--tests/src/JIT/Methodical/eh/deadcode/deadtrycatch.il82
1 files changed, 82 insertions, 0 deletions
diff --git a/tests/src/JIT/Methodical/eh/deadcode/deadtrycatch.il b/tests/src/JIT/Methodical/eh/deadcode/deadtrycatch.il
new file mode 100644
index 0000000000..5b8402ea8f
--- /dev/null
+++ b/tests/src/JIT/Methodical/eh/deadcode/deadtrycatch.il
@@ -0,0 +1,82 @@
+// dead trycatch due to a br
+
+
+.assembly extern System.Console
+{
+ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A )
+ .ver 4:0:0:0
+}
+.assembly extern mscorlib
+{
+ .ver 0:0:0:0
+}
+.assembly extern common {}
+.assembly test
+{
+ .ver 0:0:0:0
+}
+.module test.exe
+.imagebase 0x00400000
+.subsystem 0x00000003
+.file alignment 512
+.corflags 0x00000001
+
+.method public static int32 main() {
+ .entrypoint
+ .maxstack 2
+ .locals init (
+ class [mscorlib]System.IO.StringWriter expectedOut,
+ class [common]TestUtil.TestLog testLog
+ )
+
+ 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 "Done"
+ callvirt instance void [mscorlib]System.IO.TextWriter::WriteLine(string)
+ ldloc.s expectedOut
+ newobj instance void [common]TestUtil.TestLog::.ctor(object)
+ stloc.s testLog
+
+ ldloc.s testLog
+ callvirt instance void [common]TestUtil.TestLog::StartRecording()
+
+ .try {
+ ldstr "In try"
+ call void [System.Console]System.Console::WriteLine(string)
+ leave.s done
+ dead:
+ ldstr "Unreached"
+ call void [System.Console]System.Console::WriteLine(string)
+ .try
+ {
+ ldstr "In try"
+ call void [System.Console]System.Console::WriteLine(string)
+ leave.s dead
+ }
+ catch [mscorlib]System.Exception
+ {
+ ldstr "In catch, unreached"
+ call void [System.Console]System.Console::WriteLine(string)
+ leave.s done
+ }
+
+ } catch [mscorlib]System.Exception {
+ ldstr "In catch, unreached"
+ call void [System.Console]System.Console::WriteLine(string)
+ leave.s done
+ }
+
+ done:
+ ldstr "Done"
+ call void [System.Console]System.Console::WriteLine(string)
+ ldloc.s testLog
+ callvirt instance void [common]TestUtil.TestLog::StopRecording()
+
+ ldloc.s testLog
+ callvirt instance int32 [common]TestUtil.TestLog::VerifyOutput()
+ ret
+}