[CI] ignore appdomain-unload-asmload.exe on interp and full-aot
[mono.git] / mono / tests / exception9.cs
1 using System;
2
3 public class FinallyTest {
4         public static void MyHandler(object sender,
5                                      UnhandledExceptionEventArgs args) {
6
7                 Console.WriteLine("UnhandledExceptionEventHandler called");
8         }
9
10         public static void Main() {
11                 Console.WriteLine("Top level block");
12                 
13                 AppDomain domain = AppDomain.CurrentDomain;
14                 domain.UnhandledException +=
15                         new UnhandledExceptionEventHandler(MyHandler);
16                 
17                 try {
18                         Console.WriteLine("First try block");
19                         try {
20                                 Console.WriteLine("Second try block");
21                                 throw new Exception();
22                         } finally {
23                                 Console.WriteLine("Second finally block");
24                         }
25                 } finally {
26                         Console.WriteLine("First finally block");
27                 }
28
29                 Console.WriteLine("Back to top level block");
30         }
31 }
32