diff options
author | Alon Zakai <azakai@google.com> | 2024-05-01 09:52:14 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-01 09:52:14 -0700 |
commit | 58753f40d9ee51bbe5c3acb7656e0d4ab73d0f36 (patch) | |
tree | 5a0278ceb050feee6e29f4d087d96b8457682c5f /test/lit/exec | |
parent | 7d9e4a87ce4949dc552790329cfaf4dfec8b36a8 (diff) | |
download | binaryen-58753f40d9ee51bbe5c3acb7656e0d4ab73d0f36.tar.gz binaryen-58753f40d9ee51bbe5c3acb7656e0d4ab73d0f36.tar.bz2 binaryen-58753f40d9ee51bbe5c3acb7656e0d4ab73d0f36.zip |
Respect the Web limitation on Table size (#6567)
Without this the fuzzer can error on differences in behavior between V8 and us.
Also move the limitations constants to their own header.
Diffstat (limited to 'test/lit/exec')
-rw-r--r-- | test/lit/exec/table.grow.wast | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/test/lit/exec/table.grow.wast b/test/lit/exec/table.grow.wast new file mode 100644 index 000000000..83a124566 --- /dev/null +++ b/test/lit/exec/table.grow.wast @@ -0,0 +1,28 @@ +;; NOTE: Assertions have been generated by update_lit_checks.py --output=fuzz-exec and should not be edited. + +;; RUN: wasm-opt %s -all --fuzz-exec-before -q -o /dev/null 2>&1 | filecheck %s + +(module + (table $0 0 funcref) + + ;; CHECK: [fuzz-exec] calling just-right + ;; CHECK-NEXT: [fuzz-exec] note result: just-right => 0 + (func $just-right (export "just-right") (result i32) + ;; Growing up to the limit of 10*1000*1000 will succeed. + (table.grow $0 + (ref.null nofunc) + (i32.const 10000000) + ) + ) + + ;; CHECK: [fuzz-exec] calling too-much + ;; CHECK-NEXT: [fuzz-exec] note result: too-much => -1 + (func $too-much (export "too-much") (result i32) + ;; Growing beyond the limit will error and return -1. + (table.grow $0 + (ref.null nofunc) + (i32.const 10000001) + ) + ) +) + |