gcc/testsuite/g++.dg/opt/pr90026.C
raw| 1 | // PR rtl-optimization/90026 |
| 2 | // { dg-do compile } |
| 3 | // { dg-options "-fnon-call-exceptions -ftracer -O2 -w" } |
| 4 | |
| 5 | typedef __SIZE_TYPE__ size_t; |
| 6 | struct S { int *b; ~S () { delete b; } }; |
| 7 | void bar (); |
| 8 | char c[sizeof (int)]; |
| 9 | |
| 10 | void * |
| 11 | operator new (size_t, void *) |
| 12 | { |
| 13 | __builtin_unreachable (); |
| 14 | } |
| 15 | |
| 16 | void |
| 17 | foo () |
| 18 | { |
| 19 | S a; |
| 20 | if (a.b) |
| 21 | a.b = new int (); |
| 22 | bar (); |
| 23 | new (c) int (); |
| 24 | } |