@@ -11904,14 +11904,26 @@ def test_shared_memory_preprocessor_flags(self):
11904
11904
def test_wasm_worker_preprocessor_flags (self ):
11905
11905
self .run_process ([EMCC , '-c' , test_file ('wasm_worker/wasm_worker_preprocessor_flags.c' ), '-sWASM_WORKERS' ])
11906
11906
11907
+ @parameterized ({
11908
+ # we will warn here since -O2 runs the optimizer and -g enables DWARF
11909
+ 'O2_g' : (True , ['-O2' , '-g' ],),
11910
+ # asyncify will force wasm-opt to run as well, so we warn here too
11911
+ 'asyncify_g' : (True , ['-sASYNCIFY' , '-g' ],),
11912
+ # with --profiling-funcs however we do not use DWARF (we just emit the
11913
+ # names section) and will not warn.
11914
+ 'O2_pfuncs' : (False , ['-O2' , '--profiling-funcs' ],),
11915
+ })
11916
+ def test_debug_opt_warning (self , should_fail , args ):
11917
+ if should_fail :
11918
+ err = self .expect_fail ([EMCC , test_file ('hello_world.c' ), '-Werror' ] + args )
11919
+ self .assertContained ('error: running limited binaryen optimizations because DWARF info requested (or indirectly required) [-Wlimited-postlink-optimizations]' , err )
11920
+ else :
11921
+ self .run_process ([EMCC , test_file ('hello_world.c' ), '-Werror' ] + args )
11922
+
11907
11923
@also_with_minimal_runtime
11908
11924
def test_wasm_worker_closure (self ):
11909
11925
self .run_process ([EMCC , test_file ('wasm_worker/lock_async_acquire.c' ), '-O2' , '-sWASM_WORKERS' , '--closure=1' ])
11910
11926
11911
- def test_debug_opt_warning (self ):
11912
- err = self .expect_fail ([EMCC , test_file ('hello_world.c' ), '-O2' , '-g' , '-Werror' ])
11913
- self .assertContained ('error: running limited binaryen optimizations because DWARF info requested (or indirectly required) [-Wlimited-postlink-optimizations]' , err )
11914
-
11915
11927
def test_clock_nanosleep (self ):
11916
11928
self .do_runf (test_file ('other/test_clock_nanosleep.c' ))
11917
11929
0 commit comments