Ejemplo n.º 1
0
def update_lld_tests():
    print '\n[ checking wasm-emscripten-finalize testcases... ]\n'

    extension_arg_map = {
        '.out': [],
        '.jscall.out': ['--emscripten-reserved-function-pointers=3'],
    }
    for wast_path in files_with_pattern('test', 'lld', '*.wast'):
        print '..', wast_path
        for ext, ext_args in extension_arg_map.items():
            out_path = wast_path + ext
            if ext != '.out' and not os.path.exists(out_path):
                continue
            cmd = (WASM_EMSCRIPTEN_FINALIZE +
                   [wast_path, '-S', '--global-base=568'] + ext_args)
            actual = run_command(cmd)
            with open(out_path, 'w') as o:
                o.write(actual)
Ejemplo n.º 2
0
                           ] if dot_s_dir == 'llvm_autogenerated' else []
            cmd = S2WASM + [full, '--emscripten-glue'] + stack_alloc + ext_args
            if s.startswith('start_'):
                cmd.append('--start')
            actual = run_command(cmd, stderr=subprocess.PIPE, expected_err='')

            with open(expected_file, 'w') as o:
                o.write(actual)

print '\n[ checking wasm-link-metadata testcases... ]\n'

link_metadata_extension_arg_map = {
    '.json': [],
    '.jscall.json': ['--emscripten-reserved-function-pointers=3'],
}
for obj_path in files_with_pattern('test', 'lld', '*.o'):
    print '..', obj_path
    for ext, ext_args in link_metadata_extension_arg_map.items():
        json_path = obj_path.replace('.o', ext)
        if ext != 'json' and not os.path.exists(json_path):
            continue
        cmd = WASM_LINK_METADATA + [obj_path] + ext_args
        actual = run_command(cmd)
        with open(json_path, 'w') as o:
            o.write(actual)

print '\n[ checking wasm-emscripten-finalize testcases... ]\n'

emscripten_finalize_extension_arg_map = {
    '.out': [],
    '.jscall.out': ['--emscripten-reserved-function-pointers=3'],