File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -3029,6 +3029,28 @@ def test_multiexception(self):
3029
3029
Exiting setjmp function, level: 0, prev_jmp: -1
3030
3030
''')
3031
3031
3032
+ def test_std_exception(self):
3033
+ if self.emcc_args is None: return self.skip('requires emcc')
3034
+ Settings.DISABLE_EXCEPTION_CATCHING = 0
3035
+ self.emcc_args += ['-s', 'SAFE_HEAP=0']
3036
+
3037
+ src = r'''
3038
+ #include <stdio.h>
3039
+ #include <exception>
3040
+
3041
+ int main()
3042
+ {
3043
+ std::exception e;
3044
+ try {
3045
+ throw e;
3046
+ } catch(std::exception e) {
3047
+ printf("caught std::exception\n");
3048
+ }
3049
+ return 0;
3050
+ }
3051
+ '''
3052
+ self.do_run(src, 'caught std::exception')
3053
+
3032
3054
def test_exit_stack(self):
3033
3055
if self.emcc_args is None: return self.skip('requires emcc')
3034
3056
if Settings.ASM_JS: return self.skip('uses report_stack without exporting')
You can’t perform that action at this time.
0 commit comments