summaryrefslogtreecommitdiff
path: root/test/unit/test_finalize.py
blob: cdcfe27e80903292d0d03f07924ee3bff5731270 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
from scripts.test.shared import WASM_EMSCRIPTEN_FINALIZE, run_process
from .utils import BinaryenTestCase
import os


class EmscriptenFinalizeTest(BinaryenTestCase):
    def test_em_asm_mangled_string(self):
        input_dir = os.path.dirname(__file__)
        p = run_process(WASM_EMSCRIPTEN_FINALIZE + [
            os.path.join(input_dir, 'input', 'em_asm_mangled_string.wast'), '-o', os.devnull, '--global-base=1024'
        ], check=False, capture_output=True)
        self.assertNotEqual(p.returncode, 0)
        self.assertIn('Fatal: local.get of unknown in arg0 of call to $emscripten_asm_const_int (used by EM_ASM* macros) in function $main.', p.stderr)
        self.assertIn('This might be caused by aggressive compiler transformations. Consider using EM_JS instead.', p.stderr)