gcc/testsuite/g++.dg/eh/array1.C
raw| 1 | // Test that we have one EH cleanup region for the whole array |
| 2 | // rather than one for each element. |
| 3 | // { dg-options "-fdump-tree-gimple" } |
| 4 | |
| 5 | #if __cplusplus < 201100L |
| 6 | #define NOTHROW throw() |
| 7 | #else |
| 8 | #define NOTHROW noexcept |
| 9 | #endif |
| 10 | |
| 11 | struct A |
| 12 | { |
| 13 | A(); |
| 14 | ~A() NOTHROW; |
| 15 | }; |
| 16 | |
| 17 | void f() |
| 18 | { |
| 19 | A a[10] = { }; |
| 20 | } |
| 21 | |
| 22 | // { dg-final { scan-tree-dump-times "catch" 1 "gimple" } } |