2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.dg / expr / anew1.C
bloba14408ace0ab23b2f2197cb5c010d3f458c9be8d
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 int* allocate(int n)
9   return new int[n]();
12 int main()
14   const int n = 17;
15   int* p = allocate(n);
16   for (int i = 0; i < n; ++i)
17     if (p[i] != 0)
18       return 1;
19   return 0;