@@ -1595,7 +1595,9 @@ def test_iostream_ctors(self):
1595
1595
}
1596
1596
''' , 'bugfree code' )
1597
1597
1598
- @also_with_standalone_wasm
1598
+ # Marked as impure since the WASI reactor modules (modules without main)
1599
+ # are not yet suppored by the wasm engines we test against.
1600
+ @also_with_impure_standalone_wasm
1599
1601
def test_ctors_no_main (self ):
1600
1602
self .emcc_args .append ('--no-entry' )
1601
1603
self .do_run_in_out_file_test ('tests' , 'core' , 'test_ctors_no_main' )
@@ -8852,22 +8854,6 @@ def test_safe_stack_dylink(self):
8852
8854
}
8853
8855
''' , ['abort(stack overflow)' , '__handle_stack_overflow' ], assert_returncode = None )
8854
8856
8855
- @also_with_standalone_wasm
8856
- def test_undefined_main (self ):
8857
- if self .get_setting ('LLD_REPORT_UNDEFINED' ):
8858
- self .skipTest ('LLD_REPORT_UNDEFINED does not allow implicit undefined main' )
8859
- if self .get_setting ('STRICT' ):
8860
- self .skipTest ('STRICT does not allow implicit undefined main' )
8861
- # By default in emscripten we allow main to be undefined. Its used when
8862
- # building library code that has no main.
8863
- # TODO(sbc): Simplify the code by making this an opt-in feature.
8864
- # https://github.com/emscripten-core/emscripten/issues/9640
8865
- src = '''
8866
- #include <emscripten.h>
8867
- EMSCRIPTEN_KEEPALIVE void foo() {}
8868
- '''
8869
- self .build (src , self .get_dir (), 'test.c' )
8870
-
8871
8857
def test_fpic_static (self ):
8872
8858
self .emcc_args .append ('-fPIC' )
8873
8859
self .do_run_in_out_file_test ('tests' , 'core' , 'test_hello_world' )
@@ -8909,16 +8895,23 @@ def test_minimal_runtime_emscripten_get_exported_function(self):
8909
8895
self .emcc_args += ['-lexports.js' , '-s' , 'MINIMAL_RUNTIME=1' ]
8910
8896
self .do_run_in_out_file_test ('tests' , 'core' , 'test_get_exported_function' )
8911
8897
8912
- def test_auto_detect_main (self ):
8913
- if not self .get_setting ('LLD_REPORT_UNDEFINED' ) and not self .get_setting ('STRICT' ):
8898
+ # Marked as impure since the WASI reactor modules (modules without main)
8899
+ # are not yet suppored by the wasm engines we test against.
8900
+ @also_with_impure_standalone_wasm
8901
+ def test_undefined_main (self ):
8902
+ # Traditionally in emscripten we allow main to be undefined. This allows programs with a main
8903
+ # and libraries without a main to be compiled identically.
8904
+ # However we are trying to move away from that model to a more explicit opt-out model. See:
8905
+ # https://github.com/emscripten-core/emscripten/issues/9640
8906
+ if not self .get_setting ('LLD_REPORT_UNDEFINED' ) and not self .get_setting ('STRICT' ) and not self .get_setting ('STANDALONE_WASM' ):
8914
8907
self .do_run_in_out_file_test ('tests' , 'core' , 'test_ctors_no_main' )
8915
8908
8916
8909
# Disabling IGNORE_MISSING_MAIN should cause link to fail due to missing main
8917
8910
self .set_setting ('IGNORE_MISSING_MAIN' , 0 )
8918
8911
err = self .expect_fail ([PYTHON , EMCC , path_from_root ('tests' , 'core' , 'test_ctors_no_main.cpp' )] + self .get_emcc_args ())
8919
8912
self .assertContained ('error: entry symbol not defined (pass --no-entry to suppress): main' , err )
8920
8913
8921
- # We can fix the error either by adding --no-entry or by setting EXPORTED_FUNCTIONS to empty
8914
+ # If we pass --no-entry or set EXPORTED_FUNCTIONS to empty should never see any errors
8922
8915
self .emcc_args .append ('--no-entry' )
8923
8916
self .do_run_in_out_file_test ('tests' , 'core' , 'test_ctors_no_main' )
8924
8917
0 commit comments