From cde2a52fc6d679d53d1c5b72b081992d53e01c6b Mon Sep 17 00:00:00 2001 From: Thomas Lively Date: Wed, 14 Aug 2024 15:03:48 -0400 Subject: Heap type `none` requires GC (#6840) Since reference types only introduced function and extern references, all of the types in the `any` hierarchy require GC, including `none`. Fixes #6839. --- test/lit/validation/nullref-no-gc.wast | 11 +++++++++++ test/lit/validation/shared-null.wast | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 test/lit/validation/nullref-no-gc.wast (limited to 'test/lit/validation') diff --git a/test/lit/validation/nullref-no-gc.wast b/test/lit/validation/nullref-no-gc.wast new file mode 100644 index 000000000..27560b3ff --- /dev/null +++ b/test/lit/validation/nullref-no-gc.wast @@ -0,0 +1,11 @@ +;; Test that nullref without GC is a validation error. + +;; RUN: not wasm-opt %s -all --disable-gc 2>&1 | filecheck %s + +;; CHECK: all used types should be allowed + +(module + (func $test + (local nullref) + ) +) diff --git a/test/lit/validation/shared-null.wast b/test/lit/validation/shared-null.wast index 1c34873bb..0e491dd90 100644 --- a/test/lit/validation/shared-null.wast +++ b/test/lit/validation/shared-null.wast @@ -4,7 +4,7 @@ ;; RUN: wasm-opt %s --enable-reference-types --enable-gc --enable-shared-everything -o - -S | filecheck %s --check-prefix SHARED ;; NO-SHARED: ref.null requires additional features -;; NO-SHARED: [--enable-reference-types --enable-shared-everything] +;; NO-SHARED: [--enable-reference-types --enable-gc --enable-shared-everything] ;; SHARED: (ref.null (shared none)) (module -- cgit v1.2.3