diff options
-rwxr-xr-x | emscripten.py | 2 | ||||
-rw-r--r-- | tests/test_other.py | 10 |
2 files changed, 12 insertions, 0 deletions
diff --git a/emscripten.py b/emscripten.py index 37e1c83f..7f8b5505 100755 --- a/emscripten.py +++ b/emscripten.py @@ -746,6 +746,8 @@ def emscript_fast(infile, settings, outfile, libraries=[], compiler_engine=None, backend_args += ['-emscripten-warn-unaligned'] if settings['RESERVED_FUNCTION_POINTERS'] > 0: backend_args += ['-emscripten-reserved-function-pointers=%d' % settings['RESERVED_FUNCTION_POINTERS']] + if settings['ASSERTIONS'] > 0: + backend_args += ['-emscripten-assertions=%d' % settings['ASSERTIONS']] if DEBUG: logging.debug('emscript: llvm backend: ' + ' '.join(backend_args)) t = time.time() diff --git a/tests/test_other.py b/tests/test_other.py index 2fecf09e..8eb6ce4a 100644 --- a/tests/test_other.py +++ b/tests/test_other.py @@ -2542,3 +2542,13 @@ int main() for e in expected: self.assertContained(e, output) + def test_incorrect_static_call(self): + for opts in [0, 1]: + for asserts in [0, 1]: + extra = [] + if opts != 1-asserts: extra = ['-s', 'ASSERTIONS=' + str(asserts)] + cmd = [PYTHON, EMCC, path_from_root('tests', 'cases', 'sillyfuncast2.ll'), '-O' + str(opts)] + extra + print cmd + stdout, stderr = Popen(cmd, stderr=PIPE).communicate() + assert ('''unexpected number of arguments 3 in call to 'doit', should be 2''' in stderr) == asserts, stderr + |