eol
[mcs.git] / tests / test-18.cs
blobeb2a02c003327bea4500efd4d29c4b73d3847c00
1 using System;
3 class X {
4 static int i;
5 static int j;
7 static void m ()
9 i = 0;
10 j = 0;
12 try {
13 throw new ArgumentException ("Blah");
14 } catch (ArgumentException){
15 i = 1;
16 } catch (Exception){
17 i = 2;
18 } finally {
19 j = 1;
23 static int ret (int a)
25 try {
26 if (a == 1)
27 throw new Exception ();
29 return 1;
30 } catch {
31 return 2;
35 static int Main ()
37 m ();
38 if (i != 1)
39 return 1;
40 if (j != 1)
41 return 2;
43 if (ret (1) != 2)
44 return 3;
46 if (ret (10) != 1)
47 return 4;
49 return 0;