@@ -2167,8 +2167,8 @@ def test_undefined_symbols(self, action):
21672167 print (proc .stderr )
21682168 if value or action is None :
21692169 # The default is that we error in undefined symbols
2170- self .assertContained ('error: undefined symbol: something' , proc .stderr )
2171- self .assertContained ('error: undefined symbol: elsey' , proc .stderr )
2170+ self .assertContained ('undefined symbol: something' , proc .stderr )
2171+ self .assertContained ('undefined symbol: elsey' , proc .stderr )
21722172 check_success = False
21732173 elif action == 'ERROR' and not value :
21742174 # Error disables, should only warn
@@ -3548,7 +3548,7 @@ def test_js_lib_missing_sig(self):
35483548 def test_js_lib_quoted_key (self ):
35493549 create_file ('lib.js' , r'''
35503550mergeInto(LibraryManager.library, {
3551- __internal_data:{
3551+ __internal_data:{
35523552 '<' : 0,
35533553 'white space' : 1
35543554 },
@@ -6591,7 +6591,7 @@ def test_no_warn_exported_jslibfunc(self):
65916591 err = self .expect_fail ([EMCC , test_file ('hello_world.c' ),
65926592 '-sDEFAULT_LIBRARY_FUNCS_TO_INCLUDE=alGetError' ,
65936593 '-sEXPORTED_FUNCTIONS=_main,_alGet' ])
6594- self .assertContained ('undefined exported symbol: "_alGet"' , err )
6594+ self .assertContained ('error: undefined exported symbol: "_alGet" [-Wundefined] [-Werror] ' , err )
65956595
65966596 def test_musl_syscalls (self ):
65976597 self .run_process ([EMCC , test_file ('hello_world.c' )])
@@ -8361,7 +8361,7 @@ def test_full_js_library(self):
83618361 def test_full_js_library_undefined (self ):
83628362 create_file ('main.c' , 'void foo(); int main() { foo(); return 0; }' )
83638363 err = self .expect_fail ([EMCC , 'main.c' , '-sSTRICT_JS' , '-sINCLUDE_FULL_LIBRARY' ])
8364- self .assertContained ('error: undefined symbol: foo' , err )
8364+ self .assertContained ('undefined symbol: foo' , err )
83658365
83668366 def test_full_js_library_except (self ):
83678367 self .set_setting ('INCLUDE_FULL_LIBRARY' , 1 )
@@ -9017,19 +9017,20 @@ def test_js_preprocess(self):
90179017
90189018 err = self .run_process ([EMCC , test_file ('hello_world.c' ), '--js-library' , 'lib.js' ], stderr = PIPE ).stderr
90199019 self .assertContained ('JSLIB: none of the above' , err )
9020- self .assertEqual (err .count ('JSLIB' ), 1 )
9020+ self .assertNotContained ('JSLIB: MAIN_MODULE' , err )
9021+ self .assertNotContained ('JSLIB: EXIT_RUNTIME' , err )
90219022
90229023 err = self .run_process ([EMCC , test_file ('hello_world.c' ), '--js-library' , 'lib.js' , '-sMAIN_MODULE' ], stderr = PIPE ).stderr
90239024 self .assertContained ('JSLIB: MAIN_MODULE=1' , err )
9024- self .assertEqual ( err . count ( 'JSLIB' ), 1 )
9025+ self .assertNotContained ( 'JSLIB: EXIT_RUNTIME' , err )
90259026
90269027 err = self .run_process ([EMCC , test_file ('hello_world.c' ), '--js-library' , 'lib.js' , '-sMAIN_MODULE=2' ], stderr = PIPE ).stderr
90279028 self .assertContained ('JSLIB: MAIN_MODULE=2' , err )
9028- self .assertEqual ( err . count ( 'JSLIB' ), 1 )
9029+ self .assertNotContained ( 'JSLIB: EXIT_RUNTIME' , err )
90299030
90309031 err = self .run_process ([EMCC , test_file ('hello_world.c' ), '--js-library' , 'lib.js' , '-sEXIT_RUNTIME' ], stderr = PIPE ).stderr
90319032 self .assertContained ('JSLIB: EXIT_RUNTIME' , err )
9032- self .assertEqual ( err . count ( 'JSLIB' ), 1 )
9033+ self .assertNotContained ( 'JSLIB: MAIN_MODULE' , err )
90339034
90349035 def test_html_preprocess (self ):
90359036 src_file = test_file ('module/test_stdin.c' )
@@ -9202,7 +9203,7 @@ def test_dash_s_list_parsing(self):
92029203 # stray slash
92039204 ('EXPORTED_FUNCTIONS=["_a", "_b",\\ "_c", "_d"]' , 'undefined exported symbol: "\\ \\ "_c"' ),
92049205 # missing comma
9205- ('EXPORTED_FUNCTIONS=["_a", "_b" "_c", "_d"]' , 'undefined exported symbol: "_b" "_c"' ),
9206+ ('EXPORTED_FUNCTIONS=["_a", "_b" "_c", "_d"]' , 'emcc: error: undefined exported symbol: "_b" "_c" [-Wundefined] [-Werror] ' ),
92069207 ]:
92079208 print (export_arg )
92089209 proc = self .run_process ([EMCC , 'src.c' , '-s' , export_arg ], stdout = PIPE , stderr = PIPE , check = not expected )
@@ -10887,20 +10888,20 @@ def test_signature_mismatch(self):
1088710888 self .expect_fail ([EMCC , '-Wl,--fatal-warnings' , 'a.c' , 'b.c' ])
1088810889 self .expect_fail ([EMCC , '-sSTRICT' , 'a.c' , 'b.c' ])
1088910890
10891+ # TODO(sbc): Remove these tests once we remove the LLD_REPORT_UNDEFINED
1089010892 def test_lld_report_undefined (self ):
1089110893 create_file ('main.c' , 'void foo(); int main() { foo(); return 0; }' )
10892- stderr = self .expect_fail ([EMCC , '-sLLD_REPORT_UNDEFINED' , 'main.c' ])
10893- self .assertContained ('wasm-ld: error:' , stderr )
10894- self .assertContained ('main_0.o: undefined symbol: foo' , stderr )
10894+ stderr = self .expect_fail ([EMCC , '-sLLD_REPORT_UNDEFINED=0' , 'main.c' ])
10895+ self .assertContained ('error: undefined symbol: foo (referenced by top-level compiled C/C++ code)' , stderr )
1089510896
1089610897 def test_lld_report_undefined_reverse_deps (self ):
10897- self .run_process ([EMCC , '-sLLD_REPORT_UNDEFINED' , '-sREVERSE_DEPS=all' , test_file ('hello_world.c' )])
10898+ self .run_process ([EMCC , '-sLLD_REPORT_UNDEFINED=0 ' , '-sREVERSE_DEPS=all' , test_file ('hello_world.c' )])
1089810899
1089910900 def test_lld_report_undefined_exceptions (self ):
10900- self .run_process ([EMXX , '-sLLD_REPORT_UNDEFINED' , '-fwasm-exceptions' , test_file ('hello_libcxx.cpp' )])
10901+ self .run_process ([EMXX , '-sLLD_REPORT_UNDEFINED=0 ' , '-fwasm-exceptions' , test_file ('hello_libcxx.cpp' )])
1090110902
1090210903 def test_lld_report_undefined_main_module (self ):
10903- self .run_process ([EMCC , '-sLLD_REPORT_UNDEFINED' , '-sMAIN_MODULE=2' , test_file ('hello_world.c' )])
10904+ self .run_process ([EMCC , '-sLLD_REPORT_UNDEFINED=0 ' , '-sMAIN_MODULE=2' , test_file ('hello_world.c' )])
1090410905
1090510906 # Verifies that warning messages that Closure outputs are recorded to console
1090610907 def test_closure_warnings (self ):
@@ -11038,14 +11039,12 @@ def test_linker_version(self):
1103811039 def test_chained_js_error_diagnostics (self ):
1103911040 err = self .expect_fail ([EMCC , test_file ('test_chained_js_error_diagnostics.c' ), '--js-library' , test_file ('test_chained_js_error_diagnostics.js' )])
1104011041 self .assertContained ("error: undefined symbol: nonexistent_function (referenced by bar__deps: ['nonexistent_function'], referenced by foo__deps: ['bar'], referenced by top-level compiled C/C++ code)" , err )
11041- # Check that we don't recommend LLD_REPORT_UNDEFINED for chained dependencies.
11042- self .assertNotContained ('LLD_REPORT_UNDEFINED' , err )
1104311042
11044- # Test without chaining. In this case we don't include the JS library at all resulting in `foo`
11045- # being undefined in the native code and in this case we recommend LLD_REPORT_UNDEFINED .
11043+ # Test without chaining. In this case we don't include the JS library at
11044+ # all resulting in `foo` being undefined in the native code .
1104611045 err = self .expect_fail ([EMCC , test_file ('test_chained_js_error_diagnostics.c' )])
11047- self .assertContained ('error: undefined symbol: foo (referenced by top-level compiled C/C++ code) ' , err )
11048- self .assertContained ( 'Link with `-sLLD_REPORT_UNDEFINED` to get more information on undefined symbols ' , err )
11046+ self .assertContained ('undefined symbol: foo' , err )
11047+ self .assertNotContained ( 'referenced by top-level compiled C/C++ code ' , err )
1104911048
1105011049 def test_xclang_flag (self ):
1105111050 create_file ('foo.h' , ' ' )
@@ -11483,7 +11482,7 @@ def test_split_main_module(self):
1148311482
1148411483 self .run_process ([EMCC , side_src , '-sSIDE_MODULE' , '-g' , '-o' , 'libhello.wasm' ])
1148511484
11486- self .emcc_args += ['-g' ]
11485+ self .emcc_args += ['-g' , 'libhello.wasm' ]
1148711486 self .emcc_args += ['-sMAIN_MODULE=2' ]
1148811487 self .emcc_args += ['-sEXPORTED_FUNCTIONS=_printf' ]
1148911488 self .emcc_args += ['-sSPLIT_MODULE' , '-Wno-experimental' ]
@@ -11847,7 +11846,7 @@ def test_no_main_with_PROXY_TO_PTHREAD(self):
1184711846void foo() {}
1184811847''' )
1184911848 err = self .expect_fail ([EMCC , 'lib.cpp' , '-pthread' , '-sPROXY_TO_PTHREAD' ])
11850- self .assertContained ('error: PROXY_TO_PTHREAD proxies main() for you, but no main exists ' , err )
11849+ self .assertContained ('crt1_proxy_main.o: undefined symbol: main' , err )
1185111850
1185211851 def test_archive_bad_extension (self ):
1185311852 # Regression test for https://github.com/emscripten-core/emscripten/issues/14012
@@ -11889,7 +11888,7 @@ def test_unimplemented_syscalls(self, args):
1188911888 cmd = [EMCC , 'main.c' , '-sASSERTIONS' ] + args
1189011889 if args :
1189111890 err = self .expect_fail (cmd )
11892- self .assertContained ('error : undefined symbol: __syscall_mincore' , err )
11891+ self .assertContained ('libc-debug.a(mincore.o) : undefined symbol: __syscall_mincore' , err )
1189311892 else :
1189411893 self .run_process (cmd )
1189511894 err = self .run_js ('a.out.js' )
0 commit comments