* gcc.target/i386/mpx/hard-reg-1-nov.c (mpx_test): Use "esp"
[official-gcc.git] / gcc / testsuite / g++.dg / asan / pr69276.C
blob1347fae78a68e6a6122d2be649d897e605454f97
1 /* { dg-do run } */
2 /* { dg-shouldfail "asan" } */
3 /* { dg-skip-if "" { *-*-* }  { "*" } { "-O0" } } */
5 #include <stdlib.h>
7 typedef __SIZE_TYPE__ size_t;
8 inline void * operator new (size_t, void *p) { return p; }
11 struct vec
13   int size;
16 struct vnull
18   operator vec() { return vec(); }
20 vnull vNULL;
22 struct A
24   A(): value2 (vNULL), value3 (vNULL) {}
25   int value;
26   vec value2;
27   vec value3;
30 int main()
32   int *array = (int *)malloc (sizeof (int) * 1);
33   A *a = new (array) A ();
34   free (array);
37 /* { dg-output "ERROR: AddressSanitizer: heap-buffer-overflow.*(\n|\r\n|\r)" } */
38 /* { dg-output "    #0 0x\[0-9a-f\]+ +in A::A()" } */