;; 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 --legalize-js-interface --pass-arg=legalize-js-interface-export-originals -S -o - | filecheck %s (module ;; CHECK: (type $0 (func (result i64))) ;; CHECK: (type $1 (func (param i32))) ;; CHECK: (type $2 (func (result i32))) ;; CHECK: (import "env" "setTempRet0" (func $setTempRet0 (param i32))) ;; CHECK: (export "func" (func $legalstub$func)) ;; CHECK: (export "orig$func" (func $func)) (export "func" (func $func)) ;; CHECK: (func $func (result i64) ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) (func $func (result i64) (unreachable) ) ) ;; CHECK: (func $legalstub$func (result i32) ;; CHECK-NEXT: (local $0 i64) ;; CHECK-NEXT: (local.set $0 ;; CHECK-NEXT: (call $func) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (call $setTempRet0 ;; CHECK-NEXT: (i32.wrap_i64 ;; CHECK-NEXT: (i64.shr_u ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (i64.const 32) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.wrap_i64 ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: )