diff options
author | julien.hamaide <julien.hamaide@fishingcactus.com> | 2012-01-11 05:21:47 +0100 |
---|---|---|
committer | julien.hamaide <julien.hamaide@fishingcactus.com> | 2012-01-11 05:21:47 +0100 |
commit | 664caa0c759c7536bc69cb1d2e3e4f6d04e3da54 (patch) | |
tree | d25fb72456aa1d659b8802e58f7f17ed67ea25c0 /tests | |
parent | 4a472ca90a98b5d1d4084c0a501d6341a8cc2907 (diff) |
Catching specific exception type now works
Diffstat (limited to 'tests')
-rw-r--r-- | tests/runner.py | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/runner.py b/tests/runner.py index 22e8ff1d..185fdcfe 100644 --- a/tests/runner.py +++ b/tests/runner.py @@ -1189,6 +1189,42 @@ if 'benchmark' not in str(sys.argv) and 'sanity' not in str(sys.argv): Settings.DISABLE_EXCEPTION_CATCHING = 1 self.do_run(src, 'Compiled code throwing an exception') + + src = ''' + #include <iostream> + + class MyException + { + + }; + + int function() + { + throw MyException(); + } + + int function2() + { + return function(); + } + + int main() + { + try + { + function2(); + } + catch (MyException e) + { + std::cout << "Exception catched" ; + } + + return 0; + } + ''' + + Settings.DISABLE_EXCEPTION_CATCHING = 0 + self.do_run(src, 'Exception catched') def test_typed_exceptions(self): return self.skip('TODO: fix this for llvm 3.0') |