diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-05-28 11:23:36 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-05-28 11:23:36 -0700 |
commit | 3709df5c243b32f83423be3f5f200c7ec9e6f5f3 (patch) | |
tree | 0d7553da5b40db5f228950e73e1fbacb5c938ffe /tests | |
parent | d3ff354398507044b3df7aa81396a2d1b2dc8790 (diff) |
add std::exception testcase
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/runner.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/runner.py b/tests/runner.py index 72eb90ef..827f1f5b 100755 --- a/tests/runner.py +++ b/tests/runner.py @@ -3029,6 +3029,28 @@ setjmp exception execution path, level: 0, prev_jmp: -1 Exiting setjmp function, level: 0, prev_jmp: -1 ''') + def test_std_exception(self): + if self.emcc_args is None: return self.skip('requires emcc') + Settings.DISABLE_EXCEPTION_CATCHING = 0 + self.emcc_args += ['-s', 'SAFE_HEAP=0'] + + src = r''' + #include <stdio.h> + #include <exception> + + int main() + { + std::exception e; + try { + throw e; + } catch(std::exception e) { + printf("caught std::exception\n"); + } + return 0; + } + ''' + self.do_run(src, 'caught std::exception') + def test_exit_stack(self): if self.emcc_args is None: return self.skip('requires emcc') if Settings.ASM_JS: return self.skip('uses report_stack without exporting') |