Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mono / tests / async-exceptions.cs
1 //
2 // Test whenever the runtime unwinder can deal with exceptions raised in the method
3 // prolog or epilog
4 //
5 using System;
6
7 public class Tests {
8
9         // Async exceptions will be raised while executing this method
10         // On amd64, this doesn't have a frame pointer
11         static void foo () {
12                 for (int i = 0; i < 10; ++i)
13                         ;
14         }
15
16         // This does have a frame pointer
17         static void bar () {
18                 for (int i = 0; i < 10; ++i)
19                         ;
20
21                 try {
22                 } catch {
23                 }
24         }
25
26         public static int Main (String[] args) {
27                 try {
28                         foo ();
29                 } catch (NullReferenceException ex) {
30                 }
31
32                 try {
33                         bar ();
34                 } catch (NullReferenceException ex) {
35                 }
36
37                 return 0;
38         }
39 }