;; NOTE: Assertions have been generated by update_lit_checks.py and should not be edited. ;; RUN: wasm-opt %s -all --roundtrip -S -o - | filecheck %s ;; Regression test for an issue in which roundtripping failed to reproduce the ;; original types because type canonicalization was incorrect when the canonical ;; types already existed in the store. (module (rec ;; CHECK: (rec ;; CHECK-NEXT: (type $A (sub (struct (field (ref $C))))) (type $A (sub (struct (field (ref $C))))) ;; CHECK: (type $B (func (param (ref $A)) (result (ref $B)))) (type $B (func (param (ref $A)) (result (ref $B)))) ;; CHECK: (type $C (struct (field (mut (ref $B))))) (type $C (struct (field (mut (ref $B))))) ;; CHECK: (type $D (sub $A (struct (field (ref $C)) (field (ref $A))))) (type $D (sub $A (struct (field (ref $C)) (field (ref $A))))) ) ;; CHECK: (func $use-types (type $4) (param $0 (ref $A)) (param $1 (ref $D)) ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: ) (func $use-types (param (ref $A) (ref $D)) (nop) ) )