Test case for bug#433908.
authorPaolo Molaro <lupus@oddwiz.org>
Thu, 9 Oct 2008 15:50:25 +0000 (15:50 -0000)
committerPaolo Molaro <lupus@oddwiz.org>
Thu, 9 Oct 2008 15:50:25 +0000 (15:50 -0000)
svn path=/trunk/mono/; revision=115350

mono/tests/Makefile.am
mono/tests/finalize-parent.cs [new file with mode: 0644]

index d6253e3ad83eabf22a6542b2a9b9e3e12ef8bbc1..f3d7681286a34ce3705ef983d6e1e6948d700f02 100644 (file)
@@ -252,6 +252,7 @@ BASE_TEST_CS_SRC=           \
        test-type-ctor.cs       \
        soft-float-tests.cs     \
        thread-exit.cs          \
+       finalize-parent.cs      \
        assemblyresolve_event2.2.cs     \
        interlocked-2.2.cs      \
        pinvoke-2.2.cs          \
diff --git a/mono/tests/finalize-parent.cs b/mono/tests/finalize-parent.cs
new file mode 100644 (file)
index 0000000..b784b23
--- /dev/null
@@ -0,0 +1,24 @@
+using System;
+
+class P {
+
+       static public int count = 0;
+       ~P () {
+               count++;
+       }
+}
+
+class T : P {
+
+       static int Main () {
+               for (int i = 0; i < 100; ++i) {
+                       T t = new T ();
+               }
+               GC.Collect ();
+               GC.WaitForPendingFinalizers ();
+               Console.WriteLine (P.count);
+               if (P.count > 0)
+                       return 0;
+               return 1;
+       }
+}