@needs_dlfcn
@no_wasm('EM_ASM in shared wasm modules, stored inside the wasm somehow')
def test_dlfcn_em_asm(self):
    self.prep_dlfcn_lib()
    lib_src = '\n      #include <emscripten.h>\n      class Foo {\n      public:\n        Foo() {\n          EM_ASM( out("Constructing lib object.") );\n        }\n      };\n      Foo global;\n      '
    filename = 'liblib.cpp'
    self.build_dlfcn_lib(lib_src, self.get_dir(), filename)
    self.prep_dlfcn_main()
    src = '\n      #include <emscripten.h>\n      #include <dlfcn.h>\n      class Bar {\n      public:\n        Bar() {\n          EM_ASM( out("Constructing main object.") );\n        }\n      };\n      Bar global;\n      int main() {\n        dlopen("liblib.so", RTLD_NOW);\n        EM_ASM( out("All done.") );\n        return 0;\n      }\n      '
    self.do_run(src, 'Constructing main object.\nConstructing lib object.\nAll done.\n')
@needs_dlfcn
@no_wasm('EM_ASM in shared wasm modules, stored inside the wasm somehow')
def test_dlfcn_em_asm(self):
    self.prep_dlfcn_lib()
    lib_src = '\n      #include <emscripten.h>\n      class Foo {\n      public:\n        Foo() {\n          EM_ASM( out("Constructing lib object.") );\n        }\n      };\n      Foo global;\n      '
    filename = 'liblib.cpp'
    self.build_dlfcn_lib(lib_src, self.get_dir(), filename)
    self.prep_dlfcn_main()
    src = '\n      #include <emscripten.h>\n      #include <dlfcn.h>\n      class Bar {\n      public:\n        Bar() {\n          EM_ASM( out("Constructing main object.") );\n        }\n      };\n      Bar global;\n      int main() {\n        dlopen("liblib.so", RTLD_NOW);\n        EM_ASM( out("All done.") );\n        return 0;\n      }\n      '
    self.do_run(src, 'Constructing main object.\nConstructing lib object.\nAll done.\n')