summaryrefslogtreecommitdiff
path: root/test/lit/exec/table64.wast
diff options
context:
space:
mode:
Diffstat (limited to 'test/lit/exec/table64.wast')
-rw-r--r--test/lit/exec/table64.wast53
1 files changed, 53 insertions, 0 deletions
diff --git a/test/lit/exec/table64.wast b/test/lit/exec/table64.wast
new file mode 100644
index 000000000..e24741838
--- /dev/null
+++ b/test/lit/exec/table64.wast
@@ -0,0 +1,53 @@
+;; 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 -q -o /dev/null 2>&1 | filecheck %s
+
+(module
+ (type $i32 (func (result i32)))
+
+ (table $table i64 10 funcref)
+ (elem (i64.const 0) $i32)
+
+ (func $i32 (result i32)
+ (i32.const 42)
+ )
+
+ ;; CHECK: [fuzz-exec] calling call
+ ;; CHECK-NEXT: [fuzz-exec] note result: call => 42
+ (func $call (export "call") (result i32)
+ ;; This call succeeds, and calls $i32 which returns 42.
+ (call_indirect (type $i32)
+ (i64.const 0)
+ )
+ )
+
+ ;; CHECK: [fuzz-exec] calling oob
+ ;; CHECK-NEXT: [trap callTable overflow]
+ (func $oob (export "oob") (result i32)
+ ;; This call traps on oob.
+ (call_indirect (type $i32)
+ (i64.const 999)
+ )
+ )
+
+ ;; CHECK: [fuzz-exec] calling null
+ ;; CHECK-NEXT: [trap uninitialized table element]
+ (func $null (export "null") (result i32)
+ ;; This call traps on null
+ (call_indirect (type $i32)
+ (i64.const 1)
+ )
+ )
+)
+
+;; CHECK: [fuzz-exec] calling call
+;; CHECK-NEXT: [fuzz-exec] note result: call => 42
+
+;; CHECK: [fuzz-exec] calling oob
+;; CHECK-NEXT: [trap callTable overflow]
+
+;; CHECK: [fuzz-exec] calling null
+;; CHECK-NEXT: [trap uninitialized table element]
+;; CHECK-NEXT: [fuzz-exec] comparing call
+;; CHECK-NEXT: [fuzz-exec] comparing null
+;; CHECK-NEXT: [fuzz-exec] comparing oob