summaryrefslogtreecommitdiff
path: root/test/lit/exec/table.grow.wast
blob: 83a1245660336a5c1c114c927c503afaca0b58a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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)
  )
 )
)