Skip to content

Commit 2b1b813

Browse files
authored
Add test for emstrip (#16952)
2nd part of the fix for #16884
1 parent 68df71f commit 2b1b813

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

tests/common.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@
7979
EMBUILDER = shared.bat_suffix(path_from_root('embuilder'))
8080
EMMAKE = shared.bat_suffix(path_from_root('emmake'))
8181
WASM_DIS = Path(building.get_binaryen_bin(), 'wasm-dis')
82+
LLVM_OBJDUMP = os.path.expanduser(shared.build_llvm_tool_path(shared.exe_suffix('llvm-objdump')))
8283

8384

8485
def delete_contents(pathname):

tests/test_other.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
emconfig = shared.bat_suffix(path_from_root('em-config'))
4949
emsize = shared.bat_suffix(path_from_root('emsize'))
5050
emprofile = shared.bat_suffix(path_from_root('emprofile'))
51+
emstrip = shared.bat_suffix(path_from_root('emstrip'))
5152
emsymbolizer = shared.bat_suffix(path_from_root('emsymbolizer'))
5253
wasm_opt = Path(building.get_binaryen_bin(), 'wasm-opt')
5354

@@ -609,6 +610,14 @@ def test_emsize(self):
609610
output = self.run_process(cmd, stdout=PIPE).stdout
610611
self.assertContained(expected, output)
611612

613+
def test_emstrip(self):
614+
self.run_process([EMCC, test_file('hello_world.c'), '-g', '-o', 'hello.js'])
615+
output = self.run_process([common.LLVM_OBJDUMP, '-h', 'hello.wasm'], stdout=PIPE).stdout
616+
self.assertContained('.debug_info', output)
617+
self.run_process([emstrip, 'hello.wasm'])
618+
output = self.run_process([common.LLVM_OBJDUMP, '-h', 'hello.wasm'], stdout=PIPE).stdout
619+
self.assertNotContained('.debug_info', output)
620+
612621
@is_slow_test
613622
@parameterized({
614623
# ('directory to the test', 'output filename', ['extra args to pass to

0 commit comments

Comments
 (0)