Add a test for #2775.
[mono.git] / mcs / class / Mono.Debugger.Soft / Test / dtest-app.cs
index 96013b73bab1356b85e949655c4ec569343add4b..f06e73736ee0a33d23b7289df3e3920f5c92c648 100644 (file)
@@ -227,6 +227,7 @@ public class Tests : TestsBase
                dynamic_methods ();
                user ();
                type_load ();
+               regress ();
                if (args.Length > 0 && args [0] == "domain-test")
                        /* This takes a lot of time, so execute it conditionally */
                        domains ();
@@ -962,6 +963,32 @@ public class Tests : TestsBase
                var c2 = new TypeLoadClass2 ();
                c2.ToString ();
        }
+
+       [MethodImplAttribute (MethodImplOptions.NoInlining)]
+       public static void regress () {
+               regress_2755 (DateTime.Now);
+       }
+
+       [MethodImplAttribute (MethodImplOptions.NoInlining)]
+       public static unsafe void regress_2755 (DateTime d) {
+               int* buffer = stackalloc int [128];
+
+               regress_2755_2 ();
+
+               int sum = 0;
+               for (int i = 0; i < 128; ++i)
+                       sum += buffer [i];
+
+               regress_2755_3 (sum);
+       }
+
+       [MethodImplAttribute (MethodImplOptions.NoInlining)]
+       public static void regress_2755_2 () {
+       }
+
+       [MethodImplAttribute (MethodImplOptions.NoInlining)]
+       public static void regress_2755_3 (int sum) {
+       }
 }
 
 class TypeLoadClass {