;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited. ;; NOTE: This test was ported using port_passes_tests_to_lit.py and could be cleaned up. ;; RUN: foreach %s %t wasm-opt --dce --vacuum --remove-unused-names -S -o - | filecheck %s (module ;; CHECK: (type $0 (func (result i32))) ;; CHECK: (type $1 (func (param f32 f32) (result f32))) ;; CHECK: (type $2 (func (param i64) (result i64))) ;; CHECK: (func $__Z12serveroptionPc (result i32) ;; CHECK-NEXT: (return ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $__Z12serveroptionPc (result i32) (block $switch$0 (return (i32.const 0) ) (br $switch$0) ) (return (i32.const 0) ) ) ;; CHECK: (func $drop-unreachable (param $var$0 f32) (param $var$1 f32) (result f32) ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) (func $drop-unreachable (param $var$0 f32) (param $var$1 f32) (result f32) (block $label$0 (result f32) (loop $label$2 (drop (unreachable) ) (unreachable) ) (local.get $var$1) ) ) ;; CHECK: (func $set-unreachable (param $var$0 i64) (result i64) ;; CHECK-NEXT: (local $var$1 i64) ;; CHECK-NEXT: (local $var$2 i64) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i64.eq ;; CHECK-NEXT: (local.get $var$1) ;; CHECK-NEXT: (i64.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (then ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (else ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $set-unreachable (param $var$0 i64) (result i64) (local $var$1 i64) (local $var$2 i64) (block $label$0 (result i64) (block $label$1 (loop $label$2 (if (i64.eq (local.get $var$1) (i64.const 0) ) (then (unreachable) ) (else (local.set $var$2 (i64.mul (unreachable) (local.get $var$2) ) ) ) ) (br $label$2) ) ) (local.get $var$2) ) ) )