diff --git a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/Async.cs b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/Async.cs index f5d2e7a71..2c4e38545 100644 --- a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/Async.cs +++ b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/Async.cs @@ -583,6 +583,39 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty } } #endif + +#if ROSLYN + // The legacy csc lowering of await inside the null-coalescing operator is not + // reconstructed; the raw awaiter state machine leaks into the output. + public static async Task AwaitInCoalesce(Task t, Task u) + { + return (await t) ?? (await u); + } +#endif + + public static async Task DoWhileAwaitCondition(Func> t) + { + do + { + Console.WriteLine("body"); + } while (await t()); + } + +#if CS70 && !NET40 + // The legacy csc and Roslyn 1.x configurations compile against the legacy + // .NET Framework reference assemblies, which have no ValueTask. + public static async Task AwaitValueTask(ValueTask t) + { + return await t + 1; + } +#endif + +#if CS100 && !NET40 + public static async Task AwaitInInterpolationHole(Task t) + { + return $"val={await t,5:x} end"; + } +#endif } public struct AsyncInStruct