2005-03-31 Zoltan Varga <vargaz@freemail.hu>
authorZoltan Varga <vargaz@gmail.com>
Thu, 31 Mar 2005 13:47:38 +0000 (13:47 -0000)
committerZoltan Varga <vargaz@gmail.com>
Thu, 31 Mar 2005 13:47:38 +0000 (13:47 -0000)
* stack-overflow.cs: New tests, not yet enabled.

svn path=/trunk/mono/; revision=42425

mono/tests/ChangeLog
mono/tests/stack-overflow.cs [new file with mode: 0644]

index 581aaec74470cd67fd6a556ffe0edda519ba5819..ca42013bd21c6da6d76d39c03654bf95d2bb1042 100644 (file)
@@ -1,3 +1,7 @@
+2005-03-31  Zoltan Varga  <vargaz@freemail.hu>
+
+       * stack-overflow.cs: New tests, not yet enabled.
+
 2005-03-10  Zoltan Varga  <vargaz@freemail.hu>
 
        * dataslot.cs: Add tests for #65414.
diff --git a/mono/tests/stack-overflow.cs b/mono/tests/stack-overflow.cs
new file mode 100644 (file)
index 0000000..6784347
--- /dev/null
@@ -0,0 +1,41 @@
+using System;
+
+public class Tests {
+
+       struct A1 {
+               long a1, a2, a3, a4;
+       }
+
+       struct A2 {
+               A1 a1, a2, a3, a4;
+       }
+
+       struct A3 {
+               A2 a1, a2, a3, a4;
+       }
+
+       struct A4 {
+               A3 a1, a2, a3, a4;
+       }
+
+       struct A5 {
+               A4 a1, a2, a3, a4;
+       }
+
+       public static int foo () {
+               A5 a5;
+
+               return foo () + 1;
+       }
+
+       public static int Main () {
+               try {
+                       foo ();
+               }
+               catch (StackOverflowException) {
+                       Console.WriteLine ("Stack overflow caught.");
+                       return 0;
+               }
+               return 1;
+       }
+}