def test_large_exported_response(self):
    src = '\n      #include <stdio.h>\n      #include <stdlib.h>\n      #include <emscripten.h>\n\n      extern "C" {\n      '
    js_funcs = []
    num_exports = 5000
    count = 0
    while (count < num_exports):
        src += ('int exported_func_from_response_file_%d () { return %d;}\n' % (count, count))
        js_funcs.append(('_exported_func_from_response_file_%d' % count))
        count += 1
    src += '\n      }\n\n      int main() {\n        int x = EM_ASM_INT({ return Module._exported_func_from_response_file_4999() });\n        emscripten_run_script_string(""); // Add a reference to a symbol that exists in src/deps_info.json to uncover issue #2836 in the test suite.\n        printf("waka %d!\\n", x);\n        return 0;\n      }\n    '
    js_funcs.append('_main')
    exported_func_json_file = 'large_exported_response.json'
    create_test_file(exported_func_json_file, json.dumps(js_funcs))
    self.emcc_args += ['-s', ('EXPORTED_FUNCTIONS=@' + exported_func_json_file)]
    self.do_run(src, 'waka 4999!')
    assert ('_exported_func_from_response_file_1' in open('src.cpp.o.js').read())
def test_large_exported_response(self):
    src = '\n      #include <stdio.h>\n      #include <stdlib.h>\n      #include <emscripten.h>\n\n      extern "C" {\n      '
    js_funcs = []
    num_exports = 5000
    count = 0
    while (count < num_exports):
        src += ('int exported_func_from_response_file_%d () { return %d;}\n' % (count, count))
        js_funcs.append(('_exported_func_from_response_file_%d' % count))
        count += 1
    src += '\n      }\n\n      int main() {\n        int x = EM_ASM_INT({ return Module._exported_func_from_response_file_4999() });\n        emscripten_run_script_string(); // Add a reference to a symbol that exists in src/deps_info.json to uncover issue #2836 in the test suite.\n        printf("waka %d!\\n", x);\n        return 0;\n      }\n    '
    js_funcs.append('_main')
    exported_func_json_file = 'large_exported_response.json'
    create_test_file(exported_func_json_file, json.dumps(js_funcs))
    self.emcc_args += ['-s', ('EXPORTED_FUNCTIONS=@' + exported_func_json_file)]
    self.do_run(src, 'waka 4999!')
    assert ('_exported_func_from_response_file_1' in open('src.cpp.o.js').read())