Remove old asmjs-specific test. NFC. (#12619)
This commit is contained in:
Родитель
f1c87feda8
Коммит
f450c1cdfb
|
@ -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 <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
__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;
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
6
|
||||
4
|
||||
2
|
|
@ -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'])
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче