Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mcs / tests / test-async-84.cs
1 using System;
2 using System.Threading.Tasks;
3
4 struct S
5 {
6         public int value;
7         public string str;
8 }
9
10 public class Program
11 {
12         async Task<S> Foo ()
13         {
14                 return new S {
15                         value = 1,
16                         str = await DoAsync ()
17                 };
18
19         }
20
21         static async Task<string> DoAsync ()
22         {
23                 await Task.Yield ();
24                 return "asdafs";
25         }
26
27         static int Main ()
28         {
29                 var res = new Program ().Foo ().Result;
30                 if (res.value != 1)
31                         return 1;
32
33                 return 0;
34         }
35 }