gcc/testsuite/g++.old-deja/g++.law/arm13.C
raw| 1 | // { dg-do run } |
| 2 | // { dg-skip-if "requires hosted libstdc++ for stdlib malloc" { ! hostedlib } } |
| 3 | |
| 4 | // GROUPS passed ARM-compliance |
| 5 | #include <stdio.h> |
| 6 | #include <stdlib.h> |
| 7 | |
| 8 | inline void *operator new(size_t, void *place) { return place; } |
| 9 | |
| 10 | int main() |
| 11 | { |
| 12 | int* p = (int*) malloc(sizeof(int)); |
| 13 | (void) new (p) int(1); |
| 14 | typedef int I; |
| 15 | p->I::~I(); |
| 16 | free(p); |
| 17 | printf ("PASS\n"); |
| 18 | } |