2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.bugs / 900321_02.C
blob2d487646f181dd1cf863d2b25310bfc52235850c
1 // { dg-do run  }
2 // g++ 1.37.1 bug 900321_02
4 // The following program exits with a nonzero status because the constructor
5 // is not called 3 times as it should be.  This program exits with a zero
6 // status when compiled with cfront 2.0.
8 // Cfront 2.0 passes this test.
10 // keywords: arrays, initialization, default constructor, operator new
12 int call_count = 0;
14 struct struct0 {
15   struct0 ();
18 struct0::struct0 () { call_count++; }
20 typedef struct0 array[3];       // known dimension
22 int test ()
24   new array;
25   return (call_count != 3);
28 int main () { return test (); }