gcc/testsuite/g++.dg/opt/pr51117.C
raw| 1 | // PR tree-optimization/51117 |
| 2 | // { dg-do compile } |
| 3 | // { dg-options "-O2 -fexceptions" } |
| 4 | |
| 5 | struct A { char buf[64]; }; |
| 6 | void bar (A *); |
| 7 | |
| 8 | int |
| 9 | foo () |
| 10 | { |
| 11 | A c; |
| 12 | bar (&c); |
| 13 | try |
| 14 | { |
| 15 | { |
| 16 | A a; |
| 17 | bar (&a); |
| 18 | if (a.buf[13]) |
| 19 | throw 1; |
| 20 | else if (a.buf[52]) |
| 21 | throw 3; |
| 22 | } |
| 23 | { |
| 24 | A b; |
| 25 | bar (&b); |
| 26 | if (b.buf[13]) |
| 27 | throw 2; |
| 28 | } |
| 29 | } |
| 30 | catch ( ...) |
| 31 | { |
| 32 | return 1; |
| 33 | } |
| 34 | return 0; |
| 35 | } |
| 36 | |
| 37 | // { dg-final { scan-assembler-not "__cxa_rethrow" } } |