aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-01-11 21:30:03 -0800
committerAlon Zakai <alonzakai@gmail.com>2012-01-11 21:30:03 -0800
commit08d261d183a6071f8d72ea9af05c59c152f28c95 (patch)
treed0540433fef13941e37c833eecf65d2b7f756a5b /tests
parent5e107c8d5a10b74933f52cffaa27d0c01106dc60 (diff)
do not blow up the stack with lots of varargs
Diffstat (limited to 'tests')
-rw-r--r--tests/runner.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/runner.py b/tests/runner.py
index 18ce11af..dd11b950 100644
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -1459,6 +1459,26 @@ if 'benchmark' not in str(sys.argv) and 'sanity' not in str(sys.argv):
'''
self.do_run(src, 'sum:9780*')
+ # We should not blow up the stack with numerous varargs
+
+ src = r'''
+ #include <stdio.h>
+ #include <stdlib.h>
+
+ void func(int i) {
+ printf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d\n",
+ i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i);
+ }
+ int main() {
+ for (int i = 0; i < 1024; i++)
+ func(i);
+ printf("ok!\n");
+ return 0;
+ }
+ '''
+ Settings.TOTAL_STACK = 1024
+ self.do_run(src, 'ok!')
+
def test_array2(self):
src = '''
#include <stdio.h>