;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited. ;; RUN: wasm-merge %s first %s.second second %s.third third --rename-export-conflicts -all -S -o - | filecheck %s ;; Test a cycle of imports: the first module imports from the second, which ;; imports from the third, and we have a reverse cycle as well. (module (import "second" "forward" (func $second.forward)) (import "second" "reverse" (func $second.reverse)) (import "third" "forward" (func $third.forward)) (import "third" "reverse" (func $third.reverse)) ;; CHECK: (type $0 (func)) ;; CHECK: (export "forward" (func $forward)) ;; CHECK: (export "reverse" (func $reverse)) ;; CHECK: (export "forward_2" (func $forward_6)) ;; CHECK: (export "reverse_3" (func $reverse_6)) ;; CHECK: (export "forward_4" (func $forward_12)) ;; CHECK: (export "reverse_5" (func $reverse_12)) ;; CHECK: (func $forward (type $0) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (call $forward_6) ;; CHECK-NEXT: ) (func $forward (export "forward") (drop (i32.const 1) ) (call $second.forward) ) ;; CHECK: (func $reverse (type $0) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (i32.const -1) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (call $reverse_12) ;; CHECK-NEXT: ) (func $reverse (export "reverse") (drop (i32.const -1) ) (call $third.reverse) ) ) ;; CHECK: (func $forward_6 (type $0) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (call $forward_12) ;; CHECK-NEXT: ) ;; CHECK: (func $reverse_6 (type $0) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (i32.const -2) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (call $reverse) ;; CHECK-NEXT: ) ;; CHECK: (func $forward_12 (type $0) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (i32.const 3) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (call $forward) ;; CHECK-NEXT: ) ;; CHECK: (func $reverse_12 (type $0) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (i32.const -3) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (call $reverse_6) ;; CHECK-NEXT: )