diff --git a/src/tools/wasm-reduce/wasm-reduce.cpp b/src/tools/wasm-reduce/wasm-reduce.cpp index cf5855274d7..d69d698b601 100644 --- a/src/tools/wasm-reduce/wasm-reduce.cpp +++ b/src/tools/wasm-reduce/wasm-reduce.cpp @@ -279,7 +279,7 @@ struct Reducer "--dce", "--duplicate-function-elimination", "--enclose-world", - "--gto", + "--gto --closed-world", "--inlining", "--inlining-optimizing", "--optimize-level=3 --inlining-optimizing", diff --git a/test/reduce/gc.wast b/test/reduce/gc.wast index 98d1cd07545..52756d4fc7a 100644 --- a/test/reduce/gc.wast +++ b/test/reduce/gc.wast @@ -1,5 +1,6 @@ (module (rec + ;; The funcref field can be optimized away with --gto. (type $A (struct (field (mut i32)) (field funcref))) ;; This type can be optimized away. (type $unused (struct)) diff --git a/test/reduce/gc.wast.txt b/test/reduce/gc.wast.txt index 3af5287ce99..1fcf771c205 100644 --- a/test/reduce/gc.wast.txt +++ b/test/reduce/gc.wast.txt @@ -1,5 +1,5 @@ (module - (type $0 (struct (field (mut i32)) (field funcref))) + (type $0 (struct (field (mut i32)))) (type $1 (func (result i32))) (global $global$0 (ref null $0) (struct.new_default $0)) (export "use-global" (func $0))