diff options
author | Sam Clegg <sbc@chromium.org> | 2024-05-15 12:53:31 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-15 12:53:31 -0700 |
commit | 2b60f8a212c0e744d0dbf3346498b08c9a27a39e (patch) | |
tree | ee80a2e5a894c2af40972c269f2bb69089e9fdc0 /test/lit/passes | |
parent | 2cc5e06549a4019eeed7303bfab32b95c32507bc (diff) | |
download | binaryen-2b60f8a212c0e744d0dbf3346498b08c9a27a39e.tar.gz binaryen-2b60f8a212c0e744d0dbf3346498b08c9a27a39e.tar.bz2 binaryen-2b60f8a212c0e744d0dbf3346498b08c9a27a39e.zip |
Add table64 lowering pass (#6595)
Changes to wasm-validator.cpp here are mostly for consistency between
elem and data segment validation.
Diffstat (limited to 'test/lit/passes')
-rw-r--r-- | test/lit/passes/table64-lowering-features.wast | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/test/lit/passes/table64-lowering-features.wast b/test/lit/passes/table64-lowering-features.wast new file mode 100644 index 000000000..eb06231ad --- /dev/null +++ b/test/lit/passes/table64-lowering-features.wast @@ -0,0 +1,64 @@ +;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited. + +;; RUN: wasm-opt %s --enable-memory64 --enable-reference-types --enable-bulk-memory --table64-lowering -S -o - | filecheck %s + +(module + ;; CHECK: (type $0 (func)) + + ;; CHECK: (type $1 (func (result i64))) + + ;; CHECK: (table $t 10 100 funcref) + (table $t i64 10 100 funcref) + + ;; CHECK: (elem $elem (table $t) (i32.const 0) funcref (ref.null nofunc)) + (elem $elem (table $t) (i64.const 0) funcref (ref.null func)) + + ;; CHECK: (func $test_call_indirect + ;; CHECK-NEXT: (call_indirect $t (type $0) + ;; CHECK-NEXT: (i32.wrap_i64 + ;; CHECK-NEXT: (i64.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + (func $test_call_indirect + (call_indirect 0 (i64.const 0)) + ) + + ;; CHECK: (func $test_table_size (result i64) + ;; CHECK-NEXT: (i64.extend_i32_u + ;; CHECK-NEXT: (table.size $t) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + (func $test_table_size (result i64) + (table.size $t) + ) + + ;; CHECK: (func $test_table_grow (result i64) + ;; CHECK-NEXT: (i64.extend_i32_u + ;; CHECK-NEXT: (table.grow $t + ;; CHECK-NEXT: (ref.null nofunc) + ;; CHECK-NEXT: (i32.wrap_i64 + ;; CHECK-NEXT: (i64.const 10) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + (func $test_table_grow (result i64) + (table.grow $t (ref.null func) (i64.const 10)) + ) + + ;; CHECK: (func $test_table_fill + ;; CHECK-NEXT: (table.fill $t + ;; CHECK-NEXT: (i32.wrap_i64 + ;; CHECK-NEXT: (i64.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (ref.null nofunc) + ;; CHECK-NEXT: (i32.wrap_i64 + ;; CHECK-NEXT: (i64.const 10) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + (func $test_table_fill + (table.fill $t (i64.const 0) (ref.null func) (i64.const 10)) + ) +) |