;; 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 --dae-optimizing -S -o - | filecheck %s (module ;; CHECK: (type $0 (func (result i32))) (type $0 (func (param f32) (result f32))) ;; CHECK: (type $1 (func (result f32))) (type $1 (func (param f64 f32 f32 f64 f32 i64 f64) (result i32))) ;; CHECK: (type $2 (func (param f64 f32 f32 f64 f32 i32 i32 f64) (result i32))) (type $2 (func (param f64 f32 f32 f64 f32 i32 i32 f64) (result i32))) ;; CHECK: (global $global$0 (mut i32) (i32.const 10)) (global $global$0 (mut i32) (i32.const 10)) ;; CHECK: (func $0 (result i32) ;; CHECK-NEXT: (local $0 i32) ;; CHECK-NEXT: (local $1 i32) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (if (result f32) ;; CHECK-NEXT: (local.tee $0 ;; CHECK-NEXT: (i32.const 33554432) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (then ;; CHECK-NEXT: (loop $label$2 (result f32) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (global.get $global$0) ;; CHECK-NEXT: (then ;; CHECK-NEXT: (return ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.set $0 ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.set $1 ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (br_if $label$2 ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (f32.const 1) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (else ;; CHECK-NEXT: (call $1) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.const -11) ;; CHECK-NEXT: ) (func $0 (; 0 ;) (type $1) (param $0 f64) (param $1 f32) (param $2 f32) (param $3 f64) (param $4 f32) (param $5 i64) (param $6 f64) (result i32) (local $7 i32) (local $8 i32) (if (local.tee $7 (i32.const 33554432) ) (then (drop (loop $label$2 (result f32) (if (global.get $global$0) (then (return (local.get $7) ) ) ) (local.set $8 (block $label$4 (result i32) (drop (local.tee $7 (local.get $8) ) ) (i32.const 0) ) ) (br_if $label$2 (local.get $7) ) (f32.const 1) ) ) ) (else (drop (call $1 (f32.const 1) ) ) ) ) (i32.const -11) ) ;; CHECK: (func $1 (result f32) ;; CHECK-NEXT: (f32.const 0) ;; CHECK-NEXT: ) (func $1 (; 1 ;) (type $0) (param $0 f32) (result f32) (f32.const 0) ) ;; CHECK: (func $2 (param $0 f64) (param $1 f32) (param $2 f32) (param $3 f64) (param $4 f32) (param $5 i32) (param $6 i32) (param $7 f64) (result i32) ;; CHECK-NEXT: (call $0) ;; CHECK-NEXT: ) (func $2 (; 2 ;) (type $2) (param $0 f64) (param $1 f32) (param $2 f32) (param $3 f64) (param $4 f32) (param $5 i32) (param $6 i32) (param $7 f64) (result i32) (call $0 (f64.const 1) (f32.const 1) (f32.const 1) (f64.const 1) (f32.const 1) (i64.const 1) (f64.const 1) ) ) )