gcc/testsuite/g++.old-deja/g++.robertl/eb66.C
raw| 1 | // { dg-do run } |
| 2 | // { dg-skip-if "requires hosted libstdc++ for cassert" { ! hostedlib } } |
| 3 | #include <cassert> |
| 4 | #include <iostream> |
| 5 | |
| 6 | int bar () |
| 7 | { |
| 8 | throw 100; |
| 9 | } |
| 10 | |
| 11 | int main () |
| 12 | { |
| 13 | int i = 0; |
| 14 | try |
| 15 | { |
| 16 | i = bar (); |
| 17 | } |
| 18 | catch (...) |
| 19 | { |
| 20 | } |
| 21 | |
| 22 | // std::cout << "i = " << i << std::endl; |
| 23 | assert (i == 0) ; |
| 24 | } |
| 25 | |
| 26 | |
| 27 | |
| 28 |