aboutsummaryrefslogtreecommitdiff
path: root/tests/runner.py
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-04-22 13:08:40 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-04-22 13:08:40 -0700
commit247ae2e571575d3f37933de0d76f8cdedc600f2b (patch)
tree8fef2e6b4b477e0c8e38adcd4c752a905fbea29e /tests/runner.py
parent9a37f4ce7d3a36d106a04f2555f02e2e38e25ac5 (diff)
show clear error message instead of 987 when too many setjmp calls
Diffstat (limited to 'tests/runner.py')
-rwxr-xr-xtests/runner.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/runner.py b/tests/runner.py
index 811d32a5..2e01226f 100755
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -2489,6 +2489,22 @@ Calling longjmp the second time!
Exception execution path of first function! 1
''')
+ def test_setjmp_many(self):
+ src = r'''
+ #include <stdio.h>
+ #include <setjmp.h>
+
+ int main(int argc) {
+ jmp_buf buf;
+ for (int i = 0; i < NUM; i++) printf("%d\n", setjmp(buf));
+ if (argc-- == 1131) longjmp(buf, 11);
+ return 0;
+ }
+ '''
+ for num in [Settings.MAX_SETJMPS, Settings.MAX_SETJMPS+1]:
+ print num
+ self.do_run(src.replace('NUM', str(num)), '0\n' * num if num <= Settings.MAX_SETJMPS or not Settings.ASM_JS else 'build with a higher value for MAX_SETJMPS')
+
def test_exceptions(self):
if Settings.QUANTUM_SIZE == 1: return self.skip("we don't support libcxx in q1")
if self.emcc_args is None: return self.skip('need emcc to add in libcxx properly')