From 3709df5c243b32f83423be3f5f200c7ec9e6f5f3 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Tue, 28 May 2013 11:23:36 -0700 Subject: add std::exception testcase --- tests/runner.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'tests') 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 + #include + + 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') -- cgit v1.2.3-18-g5258