[jit] Fix the saving of the 'cfg->ret_var_set' flag when inlining, it was set to...
[mono.git] / mcs / tests / test-async-16.cs
index d20aeb4efd43f1fb56af1e62f884a61a763a0d16..e4f239f1c06931b0724492281e5e37f7a6f5b382 100644 (file)
@@ -59,6 +59,17 @@ class Tester : Base
                return total - 6;
        }
 
+       async Task<int> Foreach_2 ()
+       {
+               int total = 0;
+               foreach (var e in await Task.Factory.StartNew (() => new List<int> () { 1, 2, 3 }).ConfigureAwait (false)) {
+                       await Task.Yield ();
+                       total += e;
+               }
+
+               return total - 6;
+       }
+
        static bool RunTest (MethodInfo test)
        {
                Console.Write ("Running test {0, -25}", test.Name);