aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.jason/new4.C
diff options
context:
space:
mode:
authorJeffrey A Law <law@cygnus.com>1997-08-19 07:34:40 +0000
committerJeffrey A Law <law@cygnus.com>1997-08-19 07:34:40 +0000
commit78f6ae13813180b99245b321ade25c3213ec7f81 (patch)
tree335fa7ed68bccaabc938e142eabc167ac296372e /gcc/testsuite/g++.old-deja/g++.jason/new4.C
parent2fbf616b6e3115dd2835a13f83daee00913fdcbf (diff)
Initial revision
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@14840 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.jason/new4.C')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.jason/new4.C22
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.jason/new4.C b/gcc/testsuite/g++.old-deja/g++.jason/new4.C
new file mode 100644
index 00000000000..ba8af272cb5
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.jason/new4.C
@@ -0,0 +1,22 @@
+// Special g++ Options: -fcheck-new
+
+struct A {
+ A(): i(42) { }
+ A(int j): i(j) { }
+ int i;
+};
+
+A* ap = new A (1);
+A* ap2 = new A[3];
+
+main ()
+{
+ if (ap->i != 1 || ap2[0].i != 42 || ap2[1].i != 42 || ap2[2].i != 42)
+ return 1;
+
+ A* ap = new A (1);
+ A* ap2 = new A[3];
+
+ if (ap->i != 1 || ap2[0].i != 42 || ap2[1].i != 42 || ap2[2].i != 42)
+ return 1;
+}