summaryrefslogtreecommitdiff
path: root/testsuite/tests/rts/T11829_c.cpp
blob: 959851ad74800c980724714b6c09d44315e7d40f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <iostream>
#include <exception>
extern "C" {

int func() {
  try {
    throw std::runtime_error("This is a test");
  } catch(const std::runtime_error &c) {
    std::cerr << c.what() << std::endl;
    return 42;
  } catch(...) {
    std::cerr << "Catch-all must not fire!" << std::endl;
    return -1;
  }
  std::cerr << "Control must not reach past try-catch block!" << std::endl;
  return -2;
}

}