Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mcs / tests / test-async-37.cs
1 using System;
2 using System.Collections;
3 using System.Threading.Tasks;
4
5 class C
6 {
7         static async Task<int> Test ()
8         {
9                 var t = new Task<int> (() => { throw new ApplicationException ();});
10                 try {
11                         try {
12                                 t.Start ();
13                                 await t;
14                         } catch {
15                                 throw;
16                         }
17                         return -1;
18                 } catch {
19                         return 1;
20                 }   
21         }
22
23         public static int Main ()
24         {
25                 var res = Test ().Result;
26                 if (res != 1)
27                         return 1;
28                 
29                 return 0;
30         }
31 }