diff --git a/test/codesize/test_codesize_minimal_O0.json b/test/codesize/test_codesize_minimal_O0.json index f8a4d00f4cb4e..f1861463b354a 100644 --- a/test/codesize/test_codesize_minimal_O0.json +++ b/test/codesize/test_codesize_minimal_O0.json @@ -2,9 +2,9 @@ "a.out.js": 19493, "a.out.js.gz": 7010, "a.out.nodebug.wasm": 1136, - "a.out.nodebug.wasm.gz": 659, + "a.out.nodebug.wasm.gz": 656, "total": 20629, - "total_gz": 7669, + "total_gz": 7666, "sent": [], "imports": [], "exports": [ diff --git a/test/test_other.py b/test/test_other.py index f648b5681e4d9..45f299dd5afd7 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -7983,6 +7983,10 @@ def test_warn_unexported_main(self, filename, args): output = self.run_js('a.out.js') self.assertEqual('', output) + def test_no_entry_with_assertions(self): + self.run_process([EMCC, test_file('hello_world.c'), '--no-entry', '-sASSERTIONS']) + self.assertNotContained('hello, world!', self.run_js('a.out.js')) + def test_source_file_with_fixed_language_mode(self): create_file('src_tmp_fixed_lang', ''' #include diff --git a/tools/link.py b/tools/link.py index 338ff63ab5fd8..4e663367ec774 100644 --- a/tools/link.py +++ b/tools/link.py @@ -1096,7 +1096,7 @@ def limit_incoming_module_api(): if '_main' in settings.EXPORTED_FUNCTIONS or 'main' in settings.EXPORT_IF_DEFINED: settings.EXPORT_IF_DEFINED.append('__main_argc_argv') - elif settings.ASSERTIONS and not settings.STANDALONE_WASM: + elif settings.ASSERTIONS and not settings.STANDALONE_WASM and not options.no_entry: # In debug builds when `main` is not explicitly requested as an # export we still add it to EXPORT_IF_DEFINED so that we can warn # users who forget to explicitly export `main`.