@needs_dlfcn
def test_dylink_jslib(self):
    create_test_file('lib.js', '\n      mergeInto(LibraryManager.library, {\n        test_lib_func: function(x) {\n          return x + 17.2;\n        }\n      });\n    ')
    self.dylink_test(header='\n      extern "C" { extern double test_lib_func(int input); }\n    ', main='\n      #include <stdio.h>\n      #include "header.h"\n      extern double sidey();\n      int main2() { return 11; }\n      int main() {\n        int input = sidey();\n        double temp = test_lib_func(input);\n        printf("other says %.2f\\n", temp);\n        printf("more: %.5f, %d\\n", temp, input);\n        return 0;\n      }\n    ', side='\n      #include <stdio.h>\n      #include "header.h"\n      extern int main2();\n      double sidey() {\n        int temp = main2();\n        printf("main2 sed: %d\\n", temp);\n        printf("main2 sed: %u, %c\\n", temp, temp/2);\n        return test_lib_func(temp);\n      }\n    ', expected='other says 45.2', main_emcc_args=['--js-library', 'lib.js'])
@needs_dlfcn
def test_dylink_jslib(self):
    create_test_file('lib.js', '\n      mergeInto(LibraryManager.library, {\n        test_lib_func: function(x) {\n          return x + 17.2;\n        }\n      });\n    ')
    self.dylink_test(header='\n      extern "C" { extern double test_lib_func(int input); }\n    ', main='\n      #include <stdio.h>\n      #include "header.h"\n      extern double sidey();\n      int main2() { return 11; }\n      int main() {\n        int input = sidey();\n        double temp = test_lib_func(input);\n        printf("other says %.2f\\n", temp);\n        printf("more: %.5f, %d\\n", temp, input);\n        return 0;\n      }\n    ', side='\n      #include <stdio.h>\n      #include "header.h"\n      extern int main2();\n      double sidey() {\n        int temp = main2();\n        printf("main2 sed: %d\\n", temp);\n        printf("main2 sed: %u, %c\\n", temp, temp/2);\n        return test_lib_func(temp);\n      }\n    ', expected='other says 45.2', main_emcc_args=['--js-library', 'lib.js'])