repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
expr
/
anew1.C
blob
a14408ace0ab23b2f2197cb5c010d3f458c9be8d
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>
5
6
7
int* allocate(int n)
8
{
9
return new int[n]();
10
}
11
12
int main()
13
{
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;
20
}