Skip to content

Commit cab99e5

Browse files
authored
[EH] Add metadce test and LTO test for Wasm EH (#16924)
1 parent 9706dc0 commit cab99e5

6 files changed

+43
-1
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
__errno_location
2+
__indirect_function_table
3+
__wasm_call_ctors
4+
dynCall_iiiiiijj
5+
dynCall_iiiiij
6+
dynCall_iiiiijj
7+
dynCall_jiji
8+
dynCall_viijii
9+
free
10+
main
11+
memory
12+
setThrew
13+
stackAlloc
14+
stackRestore
15+
stackSave
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
env.abort
2+
env.emscripten_memcpy_big
3+
env.emscripten_resize_heap
4+
env.setTempRet0
5+
env.strftime_l
6+
wasi_snapshot_preview1.environ_get
7+
wasi_snapshot_preview1.environ_sizes_get
8+
wasi_snapshot_preview1.fd_close
9+
wasi_snapshot_preview1.fd_read
10+
wasi_snapshot_preview1.fd_seek
11+
wasi_snapshot_preview1.fd_write
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
26538
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
abort
2+
emscripten_memcpy_big
3+
emscripten_resize_heap
4+
environ_get
5+
environ_sizes_get
6+
fd_close
7+
fd_read
8+
fd_seek
9+
fd_write
10+
setTempRet0
11+
strftime_l
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
135339

tests/test_other.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7341,6 +7341,8 @@ def test_metadce_minimal_pthreads(self):
73417341
# exceptions does not pull in demangling by default, which increases code size
73427342
'mangle': (['-O2', '-fexceptions',
73437343
'-sDEMANGLE_SUPPORT'], [], ['waka']), # noqa
7344+
# Wasm EH's code size increase is smaller than that of Emscripten EH
7345+
'except_wasm': (['-O2', '-fwasm-exceptions'], [], ['waka']), # noqa
73447346
# eval_ctors 1 can partially optimize, but runs into getenv() for locale
73457347
# code. mode 2 ignores those and fully optimizes out the ctors
73467348
'ctors1': (['-O2', '-sEVAL_CTORS'], [], ['waka']), # noqa
@@ -7651,7 +7653,8 @@ def test_lto(self):
76517653

76527654
@parameterized({
76537655
'noexcept': [],
7654-
'except': ['-sDISABLE_EXCEPTION_CATCHING=0']
7656+
'except': ['-sDISABLE_EXCEPTION_CATCHING=0'],
7657+
'except_wasm': ['-fwasm-exceptions']
76557658
})
76567659
def test_lto_libcxx(self, *args):
76577660
self.run_process([EMXX, test_file('hello_libcxx.cpp'), '-flto'] + list(args))

0 commit comments

Comments
 (0)