linux-packaging-mono/mcs/tests/test-async-34.cs
Jo Shields a575963da9 Imported Upstream version 3.6.0
Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
2014-08-13 10:39:27 +01:00

38 lines
445 B
C#

using System;
using System.Threading.Tasks;
class C
{
static int called;
public static async Task Test (bool arg)
{
if (arg)
return;
called++;
await Task.FromResult (1);
}
public static async Task Test2 (bool arg)
{
if (arg)
return;
called++;
}
public static int Main ()
{
Test (true).Wait ();
if (called != 0)
return 1;
Test2 (true).Wait ();
if (called != 0)
return 2;
return 0;
}
}