@no_fastcomp('wasm-backend specific feature')
@no_asan('no wasm2js support yet in asan')
def test_wasm2js_fallback(self):
    if (self.get_setting('WASM') == 0):
        self.skipTest('redundant to test wasm2js in wasm2js* mode')
    for args in [[], ['-s', 'MINIMAL_RUNTIME=1']]:
        cmd = ([EMCC, path_from_root('tests', 'small_hello_world.c'), '-s', 'WASM=2'] + args)
        run_process(cmd)
        os.rename('a.out.wasm.js', 'a.out.wasm.js.unused')
        self.assertContained('hello!', run_js('a.out.js'))
        os.rename('a.out.wasm.js.unused', 'a.out.wasm.js')
        open('b.out.js', 'w').write(('WebAssembly = undefined;\n' + open('a.out.js', 'r').read()))
        os.remove('a.out.wasm')
        self.assertContained('hello!', run_js('b.out.js'))
@no_fastcomp('wasm-backend specific feature')
@no_asan('no wasm2js support yet in asan')
def test_wasm2js_fallback(self):
    if (self.get_setting('WASM') == 0):
        self.skipTest('redundant to test wasm2js in wasm2js* mode')
    for args in [[], ['-s', 'MINIMAL_RUNTIME=1']]:
        cmd = ([EMCC, path_from_root('tests', 'small_hello_world.c'), '-s', 'WASM=2'] + args)
        run_process(cmd)
        os.rename('a.out.wasm.js', 'a.out.wasm.js.unused')
        self.assertContained('hello!', run_js('a.out.js'))
        os.rename('a.out.wasm.js.unused', 'a.out.wasm.js')
        open('b.out.js', 'w').write(('WebAssembly = undefined;\n' + open('a.out.js', 'r').read()))
        os.remove('a.out.wasm')
        self.assertContained('hello!', run_js('b.out.js'))