Merge pull request #4431 from vkargov/vk-leaking-points
[mono.git] / mcs / tests / test-525.cs
1 using System;
2
3 class X {
4         ~X ()
5         {
6                 int id = 1;
7                 Console.WriteLine ("DESTRUCTOR!" + id);
8         }
9
10         public static int Test1()
11         {
12                 try {
13                         return 8;
14                 } catch (Exception) {}  
15                 System.Console.WriteLine("Shouldn't get here");
16                 return 9;
17         }
18
19         public static void Test2()
20         {
21                 int[] vars = { 3, 4, 5 };
22
23                 foreach (int a in vars) {
24                         try {
25                                 continue;
26                         } catch (Exception) {
27                                 break;
28                         }
29                 }
30         }
31
32         public static void Main() {
33                 Test1 ();
34                 Test2 ();
35
36                 try {
37                         return;
38                 } catch (Exception) {}  
39                 System.Console.WriteLine("Shouldn't get here");
40                 return;
41         }
42 }