;; 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 --inline-main -S -o - | filecheck %s (module ;; CHECK: (type $0 (func (result i32))) ;; CHECK: (type $1 (func (param i32 i32) (result i32))) ;; CHECK: (export "main" (func $main)) (export "main" (func $main)) ;; CHECK: (func $__original_main (result i32) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) (func $__original_main (result i32) (i32.const 0) ) ;; CHECK: (func $main (param $0 i32) (param $1 i32) (result i32) ;; CHECK-NEXT: (block $__inlined_func$__original_main (result i32) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $main (param $0 i32) (param $1 i32) (result i32) (call $__original_main) ) ) (module ;; CHECK: (type $0 (func (result i32))) ;; CHECK: (type $1 (func (param i32 i32) (result i32))) ;; CHECK: (export "main" (func $main)) (export "main" (func $main)) ;; CHECK: (func $__original_main (result i32) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) (func $__original_main (result i32) (i32.const 0) ) ;; CHECK: (func $main (param $0 i32) (param $1 i32) (result i32) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) (func $main (param $0 i32) (param $1 i32) (result i32) (i32.const 0) ) ) (module ;; CHECK: (type $0 (func (param i32 i32) (result i32))) ;; CHECK: (export "main" (func $main)) (export "main" (func $main)) ;; CHECK: (func $main (param $0 i32) (param $1 i32) (result i32) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) (func $main (param $0 i32) (param $1 i32) (result i32) (i32.const 0) ) ) (module ;; CHECK: (type $0 (func (result i32))) ;; CHECK: (type $1 (func (param i32 i32) (result i32))) ;; CHECK: (export "main" (func $main)) (export "main" (func $main)) ;; CHECK: (func $__original_main (result i32) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) (func $__original_main (result i32) (i32.const 0) ) ;; CHECK: (func $main (param $0 i32) (param $1 i32) (result i32) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (call $__original_main) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (call $__original_main) ;; CHECK-NEXT: ) (func $main (param $0 i32) (param $1 i32) (result i32) (drop (call $__original_main)) (call $__original_main) ) ) (module ;; CHECK: (type $0 (func (result i32))) ;; CHECK: (func $__original_main (result i32) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) (func $__original_main (result i32) (i32.const 0) ) ) (module ;; CHECK: (type $0 (func (param i32 i32) (result i32))) ;; CHECK: (type $1 (func (result i32))) ;; CHECK: (import "env" "main" (func $main (param i32 i32) (result i32))) (import "env" "main" (func $main (param i32 i32) (result i32))) ;; CHECK: (export "main" (func $main)) (export "main" (func $main)) ;; CHECK: (func $__original_main (result i32) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) (func $__original_main (result i32) (i32.const 0) ) ) (module ;; CHECK: (type $0 (func (result i32))) ;; CHECK: (type $1 (func (param i32 i32) (result i32))) ;; CHECK: (import "env" "original_main" (func $__original_main (result i32))) (import "env" "original_main" (func $__original_main (result i32))) ;; CHECK: (export "main" (func $main)) (export "main" (func $main)) ;; CHECK: (func $main (param $0 i32) (param $1 i32) (result i32) ;; CHECK-NEXT: (call $__original_main) ;; CHECK-NEXT: ) (func $main (param $0 i32) (param $1 i32) (result i32) (call $__original_main) ) )