| ;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited. |
| |
| ;; RUN: foreach %s %t wasm-opt -all --closed-world -S -o - | filecheck %s |
| |
| ;; Test that we do not error on call.without.effects despite it being an import. |
| ;; call.without.effects does not make the types in it public, and so it can |
| ;; validate with --closed-world. |
| |
| (module |
| ;; CHECK: (type $struct (struct (field i32))) |
| (type $struct (struct i32)) |
| |
| ;; CHECK: (type $ref|$struct|_funcref_=>_none (func (param (ref $struct) funcref))) |
| |
| ;; CHECK: (type $none_=>_none (func)) |
| |
| ;; CHECK: (type $ref|$struct|_=>_none (func (param (ref $struct)))) |
| |
| ;; CHECK: (import "binaryen-intrinsics" "call.without.effects" (func $cwe (type $ref|$struct|_funcref_=>_none) (param (ref $struct) funcref))) |
| (import "binaryen-intrinsics" "call.without.effects" (func $cwe (param (ref $struct)) (param funcref))) |
| |
| ;; CHECK: (elem declare func $func) |
| |
| ;; CHECK: (func $test (type $none_=>_none) |
| ;; CHECK-NEXT: (call $cwe |
| ;; CHECK-NEXT: (struct.new $struct |
| ;; CHECK-NEXT: (i32.const 100) |
| ;; CHECK-NEXT: ) |
| ;; CHECK-NEXT: (ref.func $func) |
| ;; CHECK-NEXT: ) |
| ;; CHECK-NEXT: ) |
| (func $test |
| (call $cwe |
| (struct.new $struct |
| (i32.const 100) |
| ) |
| (ref.func $func) |
| ) |
| ) |
| |
| ;; CHECK: (func $func (type $ref|$struct|_=>_none) (param $ref (ref $struct)) |
| ;; CHECK-NEXT: (nop) |
| ;; CHECK-NEXT: ) |
| (func $func (param $ref (ref $struct)) |
| ) |
| ) |