def test_demangle_stacks_symbol_map(self):
    self.set_setting('DEMANGLE_SUPPORT', 1)
    if (('-O' in str(self.emcc_args)) and ('-O0' not in self.emcc_args) and ('-O1' not in self.emcc_args) and ('-g' not in self.emcc_args)):
        self.emcc_args += ['--llvm-opts', '0']
    else:
        self.skipTest("without opts, we don't emit a symbol map")
    self.emcc_args += ['--emit-symbol-map']
    self.do_run(open(path_from_root('tests', 'core', 'test_demangle_stacks.cpp')).read(), 'abort', assert_returncode=None)
    full_aborter = None
    short_aborter = None
    for line in open('src.cpp.o.js.symbols').readlines():
        if (':' not in line):
            continue
        (short, full) = line.split(':', 1)
        if ('Aborter' in full):
            short_aborter = short
            full_aborter = full
    self.assertIsNotNone(full_aborter)
    self.assertIsNotNone(short_aborter)
    print('full:', full_aborter, 'short:', short_aborter)
    if (SPIDERMONKEY_ENGINE and os.path.exists(SPIDERMONKEY_ENGINE[0])):
        output = run_js('src.cpp.o.js', engine=SPIDERMONKEY_ENGINE, stderr=PIPE, full_output=True, assert_returncode=None)
        if ((((' ' + short_aborter) + ' ') not in output) and (((' ' + full_aborter) + ' ') not in output)):
            if (((('\n' + short_aborter) + ' ') not in output) and ((('\n' + full_aborter) + ' ') not in output) and ((('wasm-function[' + short_aborter) + ']') not in output)):
                if (((('\n' + short_aborter) + '@') not in output) and ((('\n' + full_aborter) + '@') not in output)):
                    self.assertContained(((((((' ' + short_aborter) + ' ') + '\n') + ' ') + full_aborter) + ' '), output)
def test_demangle_stacks_symbol_map(self):
    self.set_setting('DEMANGLE_SUPPORT', 1)
    if (('-O' in str(self.emcc_args)) and ('-O0' not in self.emcc_args) and ('-O1' not in self.emcc_args) and ('-g' not in self.emcc_args)):
        self.emcc_args += ['--llvm-opts', '0']
    else:
        self.skipTest("without opts, we don't emit a symbol map")
    self.emcc_args += ['--emit-symbol-map']
    self.do_run(open(path_from_root('tests', 'core', 'test_demangle_stacks.cpp')).read(), 'abort', assert_returncode=None)
    full_aborter = None
    short_aborter = None
    for line in open('src.cpp.o.js.symbols').readlines():
        if (':' not in line):
            continue
        (short, full) = line.split(':', 1)
        if ('Aborter' in full):
            short_aborter = short
            full_aborter = full
    self.assertIsNotNone(full_aborter)
    self.assertIsNotNone(short_aborter)
    print('full:', full_aborter, 'short:', short_aborter)
    if (SPIDERMONKEY_ENGINE and os.path.exists(SPIDERMONKEY_ENGINE[0])):
        output = run_js('src.cpp.o.js', engine=SPIDERMONKEY_ENGINE, stderr=PIPE, full_output=True, assert_returncode=None)
        if ((((' ' + short_aborter) + ' ') not in output) and (((' ' + full_aborter) + ' ') not in output)):
            if (((('\n' + short_aborter) + ' ') not in output) and ((('\n' + full_aborter) + ' ') not in output) and ((('wasm-function[' + short_aborter) + ']') not in output)):
                if (((('\n' + short_aborter) + '@') not in output) and ((('\n' + full_aborter) + '@') not in output)):
                    self.assertContained(((((((' ' + short_aborter) + ' ') + '\n') + ' ') + full_aborter) + ' '), output)