eh_test_b.cc 236 B

123456789101112131415161718192021222324
  1. #include <iostream>
  2. #include <cstdlib>
  3. void
  4. foo()
  5. {
  6. }
  7. int
  8. main()
  9. {
  10. try
  11. {
  12. throw(1);
  13. }
  14. catch(int)
  15. {
  16. std::cout << "caught" << std::endl;
  17. exit(0);
  18. }
  19. std::cout << "failed" << std::endl;
  20. exit(1);
  21. }