diff options
Diffstat (limited to 'test/lit/validation/array-init-data.wast')
-rw-r--r-- | test/lit/validation/array-init-data.wast | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/test/lit/validation/array-init-data.wast b/test/lit/validation/array-init-data.wast new file mode 100644 index 000000000..088d0e9de --- /dev/null +++ b/test/lit/validation/array-init-data.wast @@ -0,0 +1,27 @@ +;; array.init_data refers to a data segment and therefore requires the datacount +;; section be emitted (so it can be validated, per the spec, using only previous +;; sections), which means bulk memory must be enabled. + +;; RUN: not wasm-opt --enable-reference-types --enable-gc %s 2>&1 | filecheck %s + +;; CHECK: Data segment operations require bulk memory + +(module + (type $0 (array i8)) + + (memory $0 16 17) + + (data $0 (i32.const 0) "") + + (func $0 + (array.init_data $0 $0 + (ref.null $0) + (i32.const 0) + (i32.const 0) + (i32.const 0) + ) + ) +) + +;; But it passes with the feature enabled. +;; RUN: wasm-opt --enable-reference-types --enable-gc --enable-bulk-memory %s |