From 36e2abbcdd22b2b1707757b49fb4ac8844f28e5d Mon Sep 17 00:00:00 2001 From: Thomas Lively Date: Tue, 10 Jan 2023 13:53:12 -0600 Subject: Represent ref.as_{func,data,i31} with RefCast (#5413) These operations are deprecated and directly representable as casts, so remove their opcodes in the internal IR and parse them as casts instead. For now, add logic to the printing and binary writing of RefCast to continue emitting the legacy instructions to minimize test changes. The few test changes necessary are because it is no longer valid to perform a ref.as_func on values outside the func type hierarchy now that ref.as_func is subject to the ref.cast validation rules. RefAsExternInternalize, RefAsExternExternalize, and RefAsNonNull are left unmodified. A future PR may remove RefAsNonNull as well, since it is also expressible with casts. --- test/lit/binary/bad-ref-as.test | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'test/lit/binary') diff --git a/test/lit/binary/bad-ref-as.test b/test/lit/binary/bad-ref-as.test index 2afa19904..3accdd553 100644 --- a/test/lit/binary/bad-ref-as.test +++ b/test/lit/binary/bad-ref-as.test @@ -1,6 +1,5 @@ ;; Test that we error properly on a file with a ref.as of a non-ref type. -;; RUN: not wasm-opt %s.wasm 2>&1 | filecheck %s - -;; CHECK: parse exception: bad input type for ref.as: i32 +;; RUN: not wasm-opt -all %s.wasm 2>&1 | filecheck %s +;; CHECK: ref.cast ref must have ref type -- cgit v1.2.3