aboutsummaryrefslogtreecommitdiff
path: root/tests/runner.py
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-07-24 13:39:25 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-07-24 13:39:25 -0700
commit6b819b6cb47be5574260dd3a41a32e59de619b71 (patch)
tree1e84f1ffaecd80ebd8b98556ce2b630d21d1a00b /tests/runner.py
parente6e22495e277b0ae62d9732ff86ccfc2529b5706 (diff)
do invoke_* on LLVM invokes using function pointers; fixes #1423
Diffstat (limited to 'tests/runner.py')
-rwxr-xr-xtests/runner.py31
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/runner.py b/tests/runner.py
index 1792b2bf..e16fc12e 100755
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -2969,6 +2969,37 @@ back
self.emcc_args.pop() ; self.emcc_args.pop() # disable closure to work around a closure bug
self.do_run(src, 'Throw...Construct...Catched...Destruct...Throw...Construct...Copy...Catched...Destruct...Destruct...')
+ def test_exception_2(self):
+ if self.emcc_args is None: return self.skip('need emcc to add in libcxx properly')
+ Settings.DISABLE_EXCEPTION_CATCHING = 0
+ src = r'''
+ #include <stdexcept>
+ #include <stdio.h>
+
+ typedef void (*FuncPtr)();
+
+ void ThrowException()
+ {
+ throw std::runtime_error("catch me!");
+ }
+
+ FuncPtr ptr = ThrowException;
+
+ int main()
+ {
+ try
+ {
+ ptr();
+ }
+ catch(...)
+ {
+ printf("Exception caught successfully!\n");
+ }
+ return 0;
+ }
+ '''
+ self.do_run(src, 'Exception caught successfully!')
+
def test_white_list_exception(self):
Settings.DISABLE_EXCEPTION_CATCHING = 2
Settings.EXCEPTION_CATCHING_WHITELIST = ["__Z12somefunctionv"]