2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.dg / expr / anew2.C
blobb8681897577b0cf5113a23f1166a38306393b0b9
1 // { dg-do run }
2 // PR 11228: array operator new, with zero-initialization and a variable sized array.
3 // Regression test for PR 
4 // Author: Matt Austern <austern@apple.com>
7 double* allocate(int n)
9   return new double[n]();
12 int main()
14   const int n = 17;
15   double* p = allocate(n);
16   for (int i = 0; i < n; ++i)
17     if (p[i] != 0.0)
18       return 1;
19   return 0;