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++.old-deja
/
g++.brendan
/
new3.C
blob
82170fdef4da0e2c9c7005586758e0d8f3a67ce8
1
// { dg-do run }
2
// GROUPS passed operator-new
3
#include <stdio.h>
4
#include <stdlib.h>
5
#include <new>
6
7
int pass = 0;
8
9
void *operator new(size_t sz) throw (std::bad_alloc) {
10
11
void *p;
12
13
pass = 1;
14
p = malloc(sz);
15
return p;
16
}
17
18
class A {
19
public:
20
A() {}
21
~A() {}
22
23
int a;
24
int b;
25
};
26
27
28
int main()
29
{
30
A *bb = new A[10];
31
delete [] bb;
32
33
if (pass)
34
printf ("PASS\n");
35
else
36
{ printf ("FAIL\n"); return 1; }
37
}