[ilasm] Don't break arguments compatiblity
[mono-project.git] / mcs / tests / test-async-65.cs
blob396723669153c5caf3ce6efed59f90d868660cdd
1 using System;
2 using System.Threading.Tasks;
4 class C
6 static int counter;
8 public static async Task TestRethrow (Exception e)
10 try {
11 throw e;
12 } catch (ApplicationException) {
13 Console.WriteLine ("x1a");
14 counter = 1;
15 await Task.Delay (1);
16 Console.WriteLine ("x2a");
17 counter = 3;
18 throw;
19 } catch {
20 counter = 9;
21 await Task.Delay (1);
22 Console.WriteLine ("ga");
23 throw;
27 public static int Main ()
29 var ex = new ApplicationException ();
30 try {
31 TestRethrow (ex).Wait ();
32 } catch (AggregateException e) {
33 if (e.InnerException != ex)
34 return 1;
37 if (counter != 3)
38 return 2;
40 var ex2 = new NotSupportedException ();
41 try {
42 TestRethrow (ex2).Wait ();
43 } catch (AggregateException e) {
44 if (e.InnerException != ex2)
45 return 3;
48 if (counter != 9)
49 return 4;
51 Console.WriteLine ("ok");
52 return 0;