In Test/System.Data:
[mono-project.git] / mono / tests / stack-overflow.cs
blob6784347b4d3942bc8ca6f86b46ae9230f017057e
1 using System;
3 public class Tests {
5 struct A1 {
6 long a1, a2, a3, a4;
9 struct A2 {
10 A1 a1, a2, a3, a4;
13 struct A3 {
14 A2 a1, a2, a3, a4;
17 struct A4 {
18 A3 a1, a2, a3, a4;
21 struct A5 {
22 A4 a1, a2, a3, a4;
25 public static int foo () {
26 A5 a5;
28 return foo () + 1;
31 public static int Main () {
32 try {
33 foo ();
35 catch (StackOverflowException) {
36 Console.WriteLine ("Stack overflow caught.");
37 return 0;
39 return 1;