File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -436,7 +436,15 @@ For more on how to optimize effectively, see
436
436
437
437
if (options.extra .count (" output" ) == 0 ) {
438
438
if (!options.quiet ) {
439
- std::cerr << " warning: no output file specified, not emitting output\n " ;
439
+ bool printsToStdout = std::any_of (
440
+ options.passes .begin (),
441
+ options.passes .end (),
442
+ [](const OptimizationOptions::PassInfo& info) {
443
+ return info.name == " print" || info.name == " print-function-map" ;
444
+ });
445
+ if (!printsToStdout) {
446
+ std::cerr << " warning: no output file specified, not emitting output\n " ;
447
+ }
440
448
}
441
449
return 0 ;
442
450
}
Original file line number Diff line number Diff line change @@ -16,3 +16,11 @@ def test_warn_on_no_output(self):
16
16
def test_quiet_suppresses_warnings (self ):
17
17
err = shared .run_process (shared .WASM_OPT + [self .input_path ('asyncify-pure.wat' ), '-q' ], stderr = subprocess .PIPE ).stderr
18
18
self .assertNotIn ('warning' , err )
19
+
20
+ def test_no_warn_on_print (self ):
21
+ err = shared .run_process (shared .WASM_OPT + [self .input_path ('asyncify-pure.wat' ), '--print' ], stderr = subprocess .PIPE ).stderr
22
+ self .assertNotIn ('warning: no output file specified, not emitting output' , err )
23
+
24
+ def test_no_warn_on_print_function_map (self ):
25
+ err = shared .run_process (shared .WASM_OPT + [self .input_path ('asyncify-pure.wat' ), '--print-function-map' ], stderr = subprocess .PIPE ).stderr
26
+ self .assertNotIn ('warning: no output file specified, not emitting output' , err )
You can’t perform that action at this time.
0 commit comments