aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.law/ctors8.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.law/ctors8.C')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.law/ctors8.C24
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.law/ctors8.C b/gcc/testsuite/g++.old-deja/g++.law/ctors8.C
new file mode 100644
index 00000000000..f773d093633
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.law/ctors8.C
@@ -0,0 +1,24 @@
+// GROUPS passed constructors
+// ctor file
+// Message-Id: <199212160609.AA18247@phecda.cs.sfu.ca>
+// From: Taj Khattra <khattra@cs.sfu.ca>
+// Subject: gcc 2.3.1 global ctor bug ?
+// Date: Tue, 15 Dec 92 22:09:37 PST
+
+#include <stdio.h>
+
+struct foo {
+ foo() : index(-1) {}
+ int index;
+};
+
+foo *arr = new foo[2];
+
+main()
+{
+ if (arr[0].index == -1
+ && arr[1].index == -1)
+ printf ("PASS\n");
+ else
+ printf ("FAIL\n");
+}