;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited. ;; Check that extern conversion instructions are emitted properly in the binary format. ;; Also check that the optimizer does not break on this code. ;; RUN: wasm-opt %s -all -O1 --roundtrip -S -o - | filecheck %s (module ;; CHECK: (type $0 (func (param (ref any)) (result (ref extern)))) ;; CHECK: (type $1 (func (param externref) (result anyref))) ;; CHECK: (export "ext" (func $extern.externalize)) ;; CHECK: (export "int" (func $extern.internalize)) ;; CHECK: (func $extern.externalize (type $0) (param $0 (ref any)) (result (ref extern)) ;; CHECK-NEXT: (extern.externalize ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $extern.externalize (export "ext") (param $x (ref any)) (result (ref extern)) (extern.externalize (local.get $x) ) ) ;; CHECK: (func $extern.internalize (type $1) (param $0 externref) (result anyref) ;; CHECK-NEXT: (extern.internalize ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $extern.internalize (export "int") (param $x (ref null extern)) (result (ref null any)) (extern.internalize (local.get $x) ) ) )