aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2014-03-03 16:34:10 -0800
committerAlon Zakai <alonzakai@gmail.com>2014-03-03 16:34:10 -0800
commit4d94ef65a6e9fc7bd4634e871e50fdda08c227a6 (patch)
tree245226e9446ffa33224c8ed240f40e841c628abf
parent7f45922c7ffa3c8591344b2851373c70a4bf05ae (diff)
forward assertions setting into backend, and test checking for invalid # of args in static calls
-rwxr-xr-xemscripten.py2
-rw-r--r--tests/test_other.py10
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
+