Skip to content

Commit 34761bb

Browse files
authored
Measure unoptmized code size in STRICT mode. NFC (#17430)
Importantly this means that we will not see the size of the legacy runtime symbols since STRICT implies LEGACY_RUNTIME.
1 parent 42794c8 commit 34761bb

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
78339
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
12126

tests/test_other.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7359,20 +7359,29 @@ def test_unoptimized_code_size(self):
73597359
# changes to the size of the unoptimized and unminified code size.
73607360
# Run with `--rebase` when this test fails.
73617361
self.build(test_file('hello_world.c'), emcc_args=['-O0'])
7362-
self.build(test_file('hello_world.c'), emcc_args=['-O0', '-sASSERTIONS=0'], output_basename='no_asserts')
73637362
self.check_expected_size_in_file('wasm',
73647363
test_file('other/test_unoptimized_code_size.wasm.size'),
73657364
os.path.getsize('hello_world.wasm'))
7366-
self.check_expected_size_in_file('wasm',
7367-
test_file('other/test_unoptimized_code_size_no_asserts.wasm.size'),
7368-
os.path.getsize('no_asserts.wasm'))
73697365
self.check_expected_size_in_file('js',
73707366
test_file('other/test_unoptimized_code_size.js.size'),
73717367
os.path.getsize('hello_world.js'))
7368+
7369+
self.build(test_file('hello_world.c'), emcc_args=['-O0', '-sASSERTIONS=0'], output_basename='no_asserts')
7370+
self.check_expected_size_in_file('wasm',
7371+
test_file('other/test_unoptimized_code_size_no_asserts.wasm.size'),
7372+
os.path.getsize('no_asserts.wasm'))
73727373
self.check_expected_size_in_file('js',
73737374
test_file('other/test_unoptimized_code_size_no_asserts.js.size'),
73747375
os.path.getsize('no_asserts.js'))
73757376

7377+
self.build(test_file('hello_world.c'), emcc_args=['-O0', '-sSTRICT'], output_basename='strict')
7378+
self.check_expected_size_in_file('wasm',
7379+
test_file('other/test_unoptimized_code_size_strict.wasm.size'),
7380+
os.path.getsize('strict.wasm'))
7381+
self.check_expected_size_in_file('js',
7382+
test_file('other/test_unoptimized_code_size_strict.js.size'),
7383+
os.path.getsize('strict.js'))
7384+
73767385
def run_metadce_test(self, filename, args=[], expected_exists=[], expected_not_exists=[], check_size=True, # noqa
73777386
check_sent=True, check_imports=True, check_exports=True, check_funcs=True):
73787387

0 commit comments

Comments
 (0)