@@ -66,6 +66,14 @@ public static async Task Test2(int i)
6666 {
6767 throw new NullReferenceException ( "Exception from Test2" ) ;
6868 }
69+
70+ [ MethodImpl ( MethodImplOptions . NoOptimization | MethodImplOptions . NoInlining ) ]
71+ [ System . Runtime . CompilerServices . RuntimeAsyncMethodGeneration ( false ) ]
72+ #line 1 "EdiOuter.cs"
73+ public static async Task EdiOuter ( )
74+ {
75+ await V2Methods . EdiMiddle ( ) ;
76+ }
6977 }
7078
7179 public class V2Methods
@@ -206,6 +214,22 @@ public static async Task Baz()
206214 if ( Random . Shared . Next ( 1 ) == 100 ) await Task . Yield ( ) ;
207215 throw new Exception ( "Exception from Baz method." ) ;
208216 }
217+
218+ [ MethodImpl ( MethodImplOptions . NoOptimization | MethodImplOptions . NoInlining ) ]
219+ [ System . Runtime . CompilerServices . RuntimeAsyncMethodGeneration ( true ) ]
220+ #line 1 "EdiMiddle.cs"
221+ public static async Task EdiMiddle ( )
222+ {
223+ await EdiInner ( ) ;
224+ }
225+
226+ [ MethodImpl ( MethodImplOptions . NoOptimization | MethodImplOptions . NoInlining ) ]
227+ [ System . Runtime . CompilerServices . RuntimeAsyncMethodGeneration ( true ) ]
228+ #line 1 "EdiInner.cs"
229+ public static async Task EdiInner ( )
230+ {
231+ throw new InvalidOperationException ( "Exception from EdiInner" ) ;
232+ }
209233 }
210234}
211235#line default
@@ -640,6 +664,12 @@ private static string FileInfoPattern(string fileLinePattern) =>
640664 @"V2Methods\.Baz\(\)" + FileInfoPattern ( @".*Baz.*\.cs:line 4" ) ,
641665 @"V2Methods\.Bux\(\)" + FileInfoPattern ( @".*Bux.*\.cs:line 6" )
642666 } } ,
667+ { "EdiOuter" , new [ ] {
668+ @"Exception from EdiInner" ,
669+ @"V2Methods\.EdiInner\(\)" + FileInfoPattern ( @".*EdiInner.*\.cs:line 3" ) ,
670+ @"V2Methods\.EdiMiddle\(\)" + FileInfoPattern ( @".*EdiMiddle.*\.cs:line 3" ) ,
671+ @"V1Methods.*EdiOuter"
672+ } } ,
643673 } ;
644674
645675 public static IEnumerable < object [ ] > Ctor_Async_TestData ( )
@@ -649,6 +679,7 @@ public static IEnumerable<object[]> Ctor_Async_TestData()
649679 yield return new object [ ] { ( ) => V2Methods . Quux ( ) , MethodExceptionStrings [ "Quux" ] } ;
650680 yield return new object [ ] { ( ) => V2Methods . Quuux ( ) , MethodExceptionStrings [ "Quuux" ] } ;
651681 yield return new object [ ] { ( ) => V2Methods . Bux ( ) , MethodExceptionStrings [ "Bux" ] } ;
682+ yield return new object [ ] { ( ) => V1Methods . EdiOuter ( ) , MethodExceptionStrings [ "EdiOuter" ] } ;
652683 }
653684
654685 [ ConditionalTheory ( typeof ( PlatformDetection ) , nameof ( PlatformDetection . IsRuntimeAsyncSupported ) ) ]
@@ -677,6 +708,7 @@ public async Task ToString_Async(Func<Task> asyncMethod, string[] expectedPatter
677708 Assert . True ( match . Success , $ "Could not find expected pattern '{ pattern } ' in exception text:\n { exceptionText } starting at index { startIndex } .") ;
678709 startIndex = match . Index + match . Length ;
679710 }
711+ Assert . DoesNotContain ( "--- End of stack trace from previous location ---" , exceptionText ) ;
680712 }
681713
682714 [ MethodImpl ( MethodImplOptions . NoOptimization | MethodImplOptions . NoInlining ) ]
0 commit comments