From 3742df024a19bcf71d2346526eceb3469507e0e8 Mon Sep 17 00:00:00 2001 From: Tim Lander Date: Thu, 23 May 2019 13:58:45 +0800 Subject: [PATCH] Revert "Add test_dylink_function_pointer_equality test (#8330)" This reverts commit 371567082c86a929b35fe13a197ffb24a58eff1e. --- tests/test_core.py | 68 ++++++++++++---------------------------------- 1 file changed, 17 insertions(+), 51 deletions(-) diff --git a/tests/test_core.py b/tests/test_core.py index 3c942b0e6d7b..03aaba919900 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -3206,6 +3206,7 @@ def dylink_test(self, main, side, expected, header=None, main_emcc_args=[], forc # side settings self.clear_setting('MAIN_MODULE') self.set_setting('SIDE_MODULE') + print(self.is_wasm()) side_suffix = 'wasm' if self.is_wasm() else 'js' if isinstance(side, list): # side is just a library @@ -3245,60 +3246,25 @@ def dylink_test(self, main, side, expected, header=None, main_emcc_args=[], forc print('flip') self.dylink_test(side, main, expected, header, main_emcc_args, force_c, need_reverse=False) - def do_basic_dylink_test(self): - self.dylink_test(r''' - #include - #include "header.h" - - int main() { - printf("other says %d.\n", sidey()); - return 0; - } - ''', ''' - #include "header.h" - - int sidey() { - return 11; - } - ''', 'other says 11.', 'extern "C" int sidey();') - @needs_dlfcn def test_dylink_basics(self): - self.do_basic_dylink_test() - - @needs_dlfcn - def test_dylink_memory_growth(self): - if not self.is_wasm(): - self.skipTest('wasm only') - self.set_setting('ALLOW_MEMORY_GROWTH', 1) - self.do_basic_dylink_test() - - @needs_dlfcn - def test_dylink_function_pointer_equality(self): - # TODO(sbc): This is currently a known failure. - # See https://github.com/emscripten-core/emscripten/issues/8268 - self.dylink_test(r''' - #include - #include "header.h" - - int main() { - void* puts_side = get_address(); - printf("main module address %p.\n", &puts); - printf("side module address address %p.\n", puts_side); - if (&puts == puts_side) - printf("success\n"); - else - printf("failure\n"); - return 0; - } - ''', ''' - #include - #include "header.h" + def test(): + self.dylink_test(''' + #include + extern "C" int sidey(); + int main() { + printf("other says %d.\\n", sidey()); + return 0; + } + ''', ''' + extern "C" int sidey() { return 11; } + ''', 'other says 11.') + test() - void* get_address() { - return (void*)&puts; - } - ''', 'failure', header='extern "C" void* get_address();') + if self.is_wasm(): + print('test memory growth with dynamic linking, which works in wasm') + self.set_setting('ALLOW_MEMORY_GROWTH', 1) + test() @needs_dlfcn def test_dylink_floats(self):