regtest: remove compiler warnings with clang
[valgrind.git] / memcheck / tests / new_override.cpp
blobf462a9cccd90443ad34a2e02bbf82573c622cbce
1 #include <stdlib.h>
2 #include <stdio.h>
3 #include <new>
5 class Test {
6 public:
7 int a, b, c, d;
8 };
10 void *operator new[](size_t size)
12 void *ret = malloc(size);
13 printf("Here.\n");
14 for (unsigned int i = 0; i < size; i++) ((char *) ret)[i] = 0xFF;
15 return ret;
18 int main(int argc, char *argv[]) {
19 Test *toto;
20 int i;
21 int j = 0;
23 toto = new Test[2];
25 for (i = 0; i < 2; i++) {
26 if (toto[i].a) {
27 j++;
29 //printf("%d : %08x %08x %08x %08x\n", i, toto[i].a, toto[i].b, toto[i].c, toto[i].d);