diff --git a/tests/core/test_stack_restore.c b/tests/core/test_stack_restore.c deleted file mode 100644 index a629f8bda..000000000 --- a/tests/core/test_stack_restore.c +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2016 The Emscripten Authors. All rights reserved. - * Emscripten is available under two separate licenses, the MIT license and the - * University of Illinois/NCSA Open Source License. Both these licenses can be - * found in the LICENSE file. - */ - -#include -#include -#include - -__attribute__((noinline)) int no_stack_usage(void) { - return 6; -} - -__attribute__((noinline)) int alloca_gets_restored(int count) { - char *buf = (char*)alloca(count); - sprintf(buf, "%d", 6444); - return strlen(buf); -} - -__attribute__((noinline)) int stack_usage(void) { - char buf[1024]; - sprintf(buf, "%d", 60); - return strlen(buf); -} - -int main(int argc, char **argv) { - printf("%d\n", no_stack_usage()); - printf("%d\n", alloca_gets_restored(200)); - printf("%d\n", stack_usage()); - return 0; -} diff --git a/tests/core/test_stack_restore.out b/tests/core/test_stack_restore.out deleted file mode 100644 index 02c399868..000000000 --- a/tests/core/test_stack_restore.out +++ /dev/null @@ -1,3 +0,0 @@ -6 -4 -2 diff --git a/tests/test_core.py b/tests/test_core.py index 04e09cfe2..1ff957727 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -825,24 +825,6 @@ base align: 0, 0, 0, 0''']) self.set_setting('GLOBAL_BASE', 102400) self.do_run_in_out_file_test('tests', 'core', 'test_stack_placement.c') - @no_wasm_backend('generated code not available in wasm') - def test_stack_restore(self): - self.emcc_args += ['-g3'] # to be able to find the generated code - - self.do_run_in_out_file_test('tests', 'core', 'test_stack_restore.c') - - generated = open('src.js').read() - - def ensure_stack_restore_count(function_name, expected_count): - code = generated[generated.find(function_name):] - code = code[:code.find('\n}') + 2] - actual_count = code.count('STACKTOP = sp') - assert actual_count == expected_count, ('Expected %d stack restorations, got %d' % (expected_count, actual_count)) + ': ' + code - - ensure_stack_restore_count('function _no_stack_usage', 0) - ensure_stack_restore_count('function _alloca_gets_restored', 1) - ensure_stack_restore_count('function _stack_usage', 1) - def test_strings(self): self.do_run_in_out_file_test('tests', 'core', 'test_strings.c', args=['wowie', 'too', '74'])