diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-05-15 12:20:16 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-05-15 12:20:16 -0700 |
commit | 866373612b51be7b24ec458f2c0e634af1902510 (patch) | |
tree | a558cfdfa6de36c4f0f107d67ec6309650463252 /tests/runner.py | |
parent | 1c072e505984973afbe43ca23e3205827dfeaf24 (diff) |
add testing for aliasing function pointers
Diffstat (limited to 'tests/runner.py')
-rwxr-xr-x | tests/runner.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/runner.py b/tests/runner.py index c17999b1..dc343673 100755 --- a/tests/runner.py +++ b/tests/runner.py @@ -7727,6 +7727,16 @@ void*:16 self.do_run(path_from_root('tests', 'cubescript'), '*\nTemp is 33\n9\n5\nhello, everyone\n*', main_file='command.cpp') + assert 'asm2g' in test_modes + if self.run_name == 'asm2g': + results = {} + results[Settings.ALIASING_FUNCTION_POINTERS] = len(open('src.cpp.o.js').read()) + Settings.ALIASING_FUNCTION_POINTERS = 1 - Settings.ALIASING_FUNCTION_POINTERS + self.do_run(path_from_root('tests', 'cubescript'), '*\nTemp is 33\n9\n5\nhello, everyone\n*', main_file='command.cpp') + results[Settings.ALIASING_FUNCTION_POINTERS] = len(open('src.cpp.o.js').read()) + print results + assert results[1] < 0.99*results[0] + def test_gcc_unmangler(self): Settings.NAMED_GLOBALS = 1 # test coverage for this @@ -9403,7 +9413,7 @@ TT = %s # asm.js exec('asm1 = make_run("asm1", compiler=CLANG, emcc_args=["-O1", "-s", "CHECK_HEAP_ALIGN=1"])') - exec('asm2 = make_run("asm2", compiler=CLANG, emcc_args=["-O2"])') + exec('asm2 = make_run("asm2", compiler=CLANG, emcc_args=["-O2", "-s", "ALIASING_FUNCTION_POINTERS=1"])') exec('asm2g = make_run("asm2g", compiler=CLANG, emcc_args=["-O2", "-g", "-s", "ASSERTIONS=1", "--memory-init-file", "1"])') exec('''asm2x86 = make_run("asm2x86", compiler=CLANG, emcc_args=["-O2", "-g", "-s", "CHECK_HEAP_ALIGN=1"], env='{"EMCC_LLVM_TARGET": "i386-pc-linux-gnu"}')''') |