diff options
-rw-r--r-- | src/postamble.js | 2 | ||||
-rw-r--r-- | tests/runner.py | 11 |
2 files changed, 12 insertions, 1 deletions
diff --git a/src/postamble.js b/src/postamble.js index ba295ea7..87850d96 100644 --- a/src/postamble.js +++ b/src/postamble.js @@ -26,7 +26,7 @@ function run(args) { __globalConstructor__(); if (Module['_main']) { - _main(argc, argv); + _main(argc, argv, 0); __shutdownRuntime__(); } } diff --git a/tests/runner.py b/tests/runner.py index 56add2db..5c95849e 100644 --- a/tests/runner.py +++ b/tests/runner.py @@ -402,6 +402,17 @@ if 'benchmark' not in sys.argv: ''' self.do_test(src, '*4*wowie*too*76*5*(null)*/* a comment */*// another', ['wowie', 'too', '74'], lambda x: x.replace('\n', '*')) + def test_mainenv(self): + src = ''' + #include <stdio.h> + int main(int argc, char **argv, char **envp) + { + printf("*%p*\\n", envp); + return 0; + } + ''' + self.do_test(src, '*0x0*') + def test_funcs(self): src = ''' #include <stdio.h> |