diff options
Diffstat (limited to 'test')
-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) + ) + ) +) + |