;;
;; Generated by ../meta/generate_table_copy.js
;; DO NOT EDIT THIS FILE.  CHANGE THE SOURCE AND REGENERATE.
;;

(module
  (func (export "ef0") (result i32) (i32.const 0))
  (func (export "ef1") (result i32) (i32.const 1))
  (func (export "ef2") (result i32) (i32.const 2))
  (func (export "ef3") (result i32) (i32.const 3))
  (func (export "ef4") (result i32) (i32.const 4))
)
(register "a")

(module
  (type (func (result i32)))  ;; type #0
  (import "a" "ef0" (func (result i32)))    ;; index 0
  (import "a" "ef1" (func (result i32)))
  (import "a" "ef2" (func (result i32)))
  (import "a" "ef3" (func (result i32)))
  (import "a" "ef4" (func (result i32)))    ;; index 4
  (table $t0 30 30 funcref)
  (table $t1 30 30 funcref)
  (elem (table $t0) (i32.const 2) func 3 1 4 1)
  (elem funcref
    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))
  (elem (table $t0) (i32.const 12) func 7 5 2 3 6)
  (elem funcref
    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))
  (elem (table $t1) (i32.const 3) func 1 3 1 4)
  (elem (table $t1) (i32.const 11) func 6 3 2 5 7)
  (func (result i32) (i32.const 5))  ;; index 5
  (func (result i32) (i32.const 6))
  (func (result i32) (i32.const 7))
  (func (result i32) (i32.const 8))
  (func (result i32) (i32.const 9))  ;; index 9
  (func (export "test")
    (nop))
  (func (export "check_t0") (param i32) (result i32)
    (call_indirect $t0 (type 0) (local.get 0)))
  (func (export "check_t1") (param i32) (result i32)
    (call_indirect $t1 (type 0) (local.get 0)))
)

(invoke "test")
(assert_trap (invoke "check_t0" (i32.const 0)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 1)) "uninitialized element")
(assert_return (invoke "check_t0" (i32.const 2)) (i32.const 3))
(assert_return (invoke "check_t0" (i32.const 3)) (i32.const 1))
(assert_return (invoke "check_t0" (i32.const 4)) (i32.const 4))
(assert_return (invoke "check_t0" (i32.const 5)) (i32.const 1))
(assert_trap (invoke "check_t0" (i32.const 6)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 7)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 8)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 9)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 10)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 11)) "uninitialized element")
(assert_return (invoke "check_t0" (i32.const 12)) (i32.const 7))
(assert_return (invoke "check_t0" (i32.const 13)) (i32.const 5))
(assert_return (invoke "check_t0" (i32.const 14)) (i32.const 2))
(assert_return (invoke "check_t0" (i32.const 15)) (i32.const 3))
(assert_return (invoke "check_t0" (i32.const 16)) (i32.const 6))
(assert_trap (invoke "check_t0" (i32.const 17)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 18)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 19)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 20)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 21)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 22)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 23)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 24)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 25)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 26)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 27)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 28)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 29)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 0)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 1)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 2)) "uninitialized element")
(assert_return (invoke "check_t1" (i32.const 3)) (i32.const 1))
(assert_return (invoke "check_t1" (i32.const 4)) (i32.const 3))
(assert_return (invoke "check_t1" (i32.const 5)) (i32.const 1))
(assert_return (invoke "check_t1" (i32.const 6)) (i32.const 4))
(assert_trap (invoke "check_t1" (i32.const 7)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 8)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 9)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 10)) "uninitialized element")
(assert_return (invoke "check_t1" (i32.const 11)) (i32.const 6))
(assert_return (invoke "check_t1" (i32.const 12)) (i32.const 3))
(assert_return (invoke "check_t1" (i32.const 13)) (i32.const 2))
(assert_return (invoke "check_t1" (i32.const 14)) (i32.const 5))
(assert_return (invoke "check_t1" (i32.const 15)) (i32.const 7))
(assert_trap (invoke "check_t1" (i32.const 16)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 17)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 18)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 19)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 20)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 21)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 22)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 23)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 24)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 25)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 26)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 27)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 28)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 29)) "uninitialized element")

(module
  (type (func (result i32)))  ;; type #0
  (import "a" "ef0" (func (result i32)))    ;; index 0
  (import "a" "ef1" (func (result i32)))
  (import "a" "ef2" (func (result i32)))
  (import "a" "ef3" (func (result i32)))
  (import "a" "ef4" (func (result i32)))    ;; index 4
  (table $t0 30 30 funcref)
  (table $t1 30 30 funcref)
  (elem (table $t0) (i32.const 2) func 3 1 4 1)
  (elem funcref
    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))
  (elem (table $t0) (i32.const 12) func 7 5 2 3 6)
  (elem funcref
    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))
  (elem (table $t1) (i32.const 3) func 1 3 1 4)
  (elem (table $t1) (i32.const 11) func 6 3 2 5 7)
  (func (result i32) (i32.const 5))  ;; index 5
  (func (result i32) (i32.const 6))
  (func (result i32) (i32.const 7))
  (func (result i32) (i32.const 8))
  (func (result i32) (i32.const 9))  ;; index 9
  (func (export "test")
    (table.copy $t0 $t0 (i32.const 13) (i32.const 2) (i32.const 3)))
  (func (export "check_t0") (param i32) (result i32)
    (call_indirect $t0 (type 0) (local.get 0)))
  (func (export "check_t1") (param i32) (result i32)
    (call_indirect $t1 (type 0) (local.get 0)))
)

(invoke "test")
(assert_trap (invoke "check_t0" (i32.const 0)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 1)) "uninitialized element")
(assert_return (invoke "check_t0" (i32.const 2)) (i32.const 3))
(assert_return (invoke "check_t0" (i32.const 3)) (i32.const 1))
(assert_return (invoke "check_t0" (i32.const 4)) (i32.const 4))
(assert_return (invoke "check_t0" (i32.const 5)) (i32.const 1))
(assert_trap (invoke "check_t0" (i32.const 6)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 7)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 8)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 9)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 10)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 11)) "uninitialized element")
(assert_return (invoke "check_t0" (i32.const 12)) (i32.const 7))
(assert_return (invoke "check_t0" (i32.const 13)) (i32.const 3))
(assert_return (invoke "check_t0" (i32.const 14)) (i32.const 1))
(assert_return (invoke "check_t0" (i32.const 15)) (i32.const 4))
(assert_return (invoke "check_t0" (i32.const 16)) (i32.const 6))
(assert_trap (invoke "check_t0" (i32.const 17)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 18)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 19)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 20)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 21)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 22)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 23)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 24)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 25)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 26)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 27)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 28)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 29)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 0)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 1)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 2)) "uninitialized element")
(assert_return (invoke "check_t1" (i32.const 3)) (i32.const 1))
(assert_return (invoke "check_t1" (i32.const 4)) (i32.const 3))
(assert_return (invoke "check_t1" (i32.const 5)) (i32.const 1))
(assert_return (invoke "check_t1" (i32.const 6)) (i32.const 4))
(assert_trap (invoke "check_t1" (i32.const 7)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 8)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 9)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 10)) "uninitialized element")
(assert_return (invoke "check_t1" (i32.const 11)) (i32.const 6))
(assert_return (invoke "check_t1" (i32.const 12)) (i32.const 3))
(assert_return (invoke "check_t1" (i32.const 13)) (i32.const 2))
(assert_return (invoke "check_t1" (i32.const 14)) (i32.const 5))
(assert_return (invoke "check_t1" (i32.const 15)) (i32.const 7))
(assert_trap (invoke "check_t1" (i32.const 16)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 17)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 18)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 19)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 20)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 21)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 22)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 23)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 24)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 25)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 26)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 27)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 28)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 29)) "uninitialized element")

(module
  (type (func (result i32)))  ;; type #0
  (import "a" "ef0" (func (result i32)))    ;; index 0
  (import "a" "ef1" (func (result i32)))
  (import "a" "ef2" (func (result i32)))
  (import "a" "ef3" (func (result i32)))
  (import "a" "ef4" (func (result i32)))    ;; index 4
  (table $t0 30 30 funcref)
  (table $t1 30 30 funcref)
  (elem (table $t0) (i32.const 2) func 3 1 4 1)
  (elem funcref
    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))
  (elem (table $t0) (i32.const 12) func 7 5 2 3 6)
  (elem funcref
    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))
  (elem (table $t1) (i32.const 3) func 1 3 1 4)
  (elem (table $t1) (i32.const 11) func 6 3 2 5 7)
  (func (result i32) (i32.const 5))  ;; index 5
  (func (result i32) (i32.const 6))
  (func (result i32) (i32.const 7))
  (func (result i32) (i32.const 8))
  (func (result i32) (i32.const 9))  ;; index 9
  (func (export "test")
    (table.copy $t0 $t0 (i32.const 25) (i32.const 15) (i32.const 2)))
  (func (export "check_t0") (param i32) (result i32)
    (call_indirect $t0 (type 0) (local.get 0)))
  (func (export "check_t1") (param i32) (result i32)
    (call_indirect $t1 (type 0) (local.get 0)))
)

(invoke "test")
(assert_trap (invoke "check_t0" (i32.const 0)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 1)) "uninitialized element")
(assert_return (invoke "check_t0" (i32.const 2)) (i32.const 3))
(assert_return (invoke "check_t0" (i32.const 3)) (i32.const 1))
(assert_return (invoke "check_t0" (i32.const 4)) (i32.const 4))
(assert_return (invoke "check_t0" (i32.const 5)) (i32.const 1))
(assert_trap (invoke "check_t0" (i32.const 6)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 7)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 8)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 9)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 10)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 11)) "uninitialized element")
(assert_return (invoke "check_t0" (i32.const 12)) (i32.const 7))
(assert_return (invoke "check_t0" (i32.const 13)) (i32.const 5))
(assert_return (invoke "check_t0" (i32.const 14)) (i32.const 2))
(assert_return (invoke "check_t0" (i32.const 15)) (i32.const 3))
(assert_return (invoke "check_t0" (i32.const 16)) (i32.const 6))
(assert_trap (invoke "check_t0" (i32.const 17)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 18)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 19)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 20)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 21)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 22)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 23)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 24)) "uninitialized element")
(assert_return (invoke "check_t0" (i32.const 25)) (i32.const 3))
(assert_return (invoke "check_t0" (i32.const 26)) (i32.const 6))
(assert_trap (invoke "check_t0" (i32.const 27)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 28)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 29)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 0)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 1)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 2)) "uninitialized element")
(assert_return (invoke "check_t1" (i32.const 3)) (i32.const 1))
(assert_return (invoke "check_t1" (i32.const 4)) (i32.const 3))
(assert_return (invoke "check_t1" (i32.const 5)) (i32.const 1))
(assert_return (invoke "check_t1" (i32.const 6)) (i32.const 4))
(assert_trap (invoke "check_t1" (i32.const 7)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 8)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 9)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 10)) "uninitialized element")
(assert_return (invoke "check_t1" (i32.const 11)) (i32.const 6))
(assert_return (invoke "check_t1" (i32.const 12)) (i32.const 3))
(assert_return (invoke "check_t1" (i32.const 13)) (i32.const 2))
(assert_return (invoke "check_t1" (i32.const 14)) (i32.const 5))
(assert_return (invoke "check_t1" (i32.const 15)) (i32.const 7))
(assert_trap (invoke "check_t1" (i32.const 16)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 17)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 18)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 19)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 20)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 21)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 22)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 23)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 24)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 25)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 26)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 27)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 28)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 29)) "uninitialized element")

(module
  (type (func (result i32)))  ;; type #0
  (import "a" "ef0" (func (result i32)))    ;; index 0
  (import "a" "ef1" (func (result i32)))
  (import "a" "ef2" (func (result i32)))
  (import "a" "ef3" (func (result i32)))
  (import "a" "ef4" (func (result i32)))    ;; index 4
  (table $t0 30 30 funcref)
  (table $t1 30 30 funcref)
  (elem (table $t0) (i32.const 2) func 3 1 4 1)
  (elem funcref
    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))
  (elem (table $t0) (i32.const 12) func 7 5 2 3 6)
  (elem funcref
    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))
  (elem (table $t1) (i32.const 3) func 1 3 1 4)
  (elem (table $t1) (i32.const 11) func 6 3 2 5 7)
  (func (result i32) (i32.const 5))  ;; index 5
  (func (result i32) (i32.const 6))
  (func (result i32) (i32.const 7))
  (func (result i32) (i32.const 8))
  (func (result i32) (i32.const 9))  ;; index 9
  (func (export "test")
    (table.copy $t0 $t0 (i32.const 13) (i32.const 25) (i32.const 3)))
  (func (export "check_t0") (param i32) (result i32)
    (call_indirect $t0 (type 0) (local.get 0)))
  (func (export "check_t1") (param i32) (result i32)
    (call_indirect $t1 (type 0) (local.get 0)))
)

(invoke "test")
(assert_trap (invoke "check_t0" (i32.const 0)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 1)) "uninitialized element")
(assert_return (invoke "check_t0" (i32.const 2)) (i32.const 3))
(assert_return (invoke "check_t0" (i32.const 3)) (i32.const 1))
(assert_return (invoke "check_t0" (i32.const 4)) (i32.const 4))
(assert_return (invoke "check_t0" (i32.const 5)) (i32.const 1))
(assert_trap (invoke "check_t0" (i32.const 6)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 7)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 8)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 9)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 10)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 11)) "uninitialized element")
(assert_return (invoke "check_t0" (i32.const 12)) (i32.const 7))
(assert_trap (invoke "check_t0" (i32.const 13)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 14)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 15)) "uninitialized element")
(assert_return (invoke "check_t0" (i32.const 16)) (i32.const 6))
(assert_trap (invoke "check_t0" (i32.const 17)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 18)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 19)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 20)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 21)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 22)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 23)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 24)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 25)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 26)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 27)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 28)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 29)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 0)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 1)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 2)) "uninitialized element")
(assert_return (invoke "check_t1" (i32.const 3)) (i32.const 1))
(assert_return (invoke "check_t1" (i32.const 4)) (i32.const 3))
(assert_return (invoke "check_t1" (i32.const 5)) (i32.const 1))
(assert_return (invoke "check_t1" (i32.const 6)) (i32.const 4))
(assert_trap (invoke "check_t1" (i32.const 7)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 8)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 9)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 10)) "uninitialized element")
(assert_return (invoke "check_t1" (i32.const 11)) (i32.const 6))
(assert_return (invoke "check_t1" (i32.const 12)) (i32.const 3))
(assert_return (invoke "check_t1" (i32.const 13)) (i32.const 2))
(assert_return (invoke "check_t1" (i32.const 14)) (i32.const 5))
(assert_return (invoke "check_t1" (i32.const 15)) (i32.const 7))
(assert_trap (invoke "check_t1" (i32.const 16)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 17)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 18)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 19)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 20)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 21)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 22)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 23)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 24)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 25)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 26)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 27)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 28)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 29)) "uninitialized element")

(module
  (type (func (result i32)))  ;; type #0
  (import "a" "ef0" (func (result i32)))    ;; index 0
  (import "a" "ef1" (func (result i32)))
  (import "a" "ef2" (func (result i32)))
  (import "a" "ef3" (func (result i32)))
  (import "a" "ef4" (func (result i32)))    ;; index 4
  (table $t0 30 30 funcref)
  (table $t1 30 30 funcref)
  (elem (table $t0) (i32.const 2) func 3 1 4 1)
  (elem funcref
    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))
  (elem (table $t0) (i32.const 12) func 7 5 2 3 6)
  (elem funcref
    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))
  (elem (table $t1) (i32.const 3) func 1 3 1 4)
  (elem (table $t1) (i32.const 11) func 6 3 2 5 7)
  (func (result i32) (i32.const 5))  ;; index 5
  (func (result i32) (i32.const 6))
  (func (result i32) (i32.const 7))
  (func (result i32) (i32.const 8))
  (func (result i32) (i32.const 9))  ;; index 9
  (func (export "test")
    (table.copy $t0 $t0 (i32.const 20) (i32.const 22) (i32.const 4)))
  (func (export "check_t0") (param i32) (result i32)
    (call_indirect $t0 (type 0) (local.get 0)))
  (func (export "check_t1") (param i32) (result i32)
    (call_indirect $t1 (type 0) (local.get 0)))
)

(invoke "test")
(assert_trap (invoke "check_t0" (i32.const 0)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 1)) "uninitialized element")
(assert_return (invoke "check_t0" (i32.const 2)) (i32.const 3))
(assert_return (invoke "check_t0" (i32.const 3)) (i32.const 1))
(assert_return (invoke "check_t0" (i32.const 4)) (i32.const 4))
(assert_return (invoke "check_t0" (i32.const 5)) (i32.const 1))
(assert_trap (invoke "check_t0" (i32.const 6)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 7)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 8)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 9)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 10)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 11)) "uninitialized element")
(assert_return (invoke "check_t0" (i32.const 12)) (i32.const 7))
(assert_return (invoke "check_t0" (i32.const 13)) (i32.const 5))
(assert_return (invoke "check_t0" (i32.const 14)) (i32.const 2))
(assert_return (invoke "check_t0" (i32.const 15)) (i32.const 3))
(assert_return (invoke "check_t0" (i32.const 16)) (i32.const 6))
(assert_trap (invoke "check_t0" (i32.const 17)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 18)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 19)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 20)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 21)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 22)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 23)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 24)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 25)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 26)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 27)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 28)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 29)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 0)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 1)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 2)) "uninitialized element")
(assert_return (invoke "check_t1" (i32.const 3)) (i32.const 1))
(assert_return (invoke "check_t1" (i32.const 4)) (i32.const 3))
(assert_return (invoke "check_t1" (i32.const 5)) (i32.const 1))
(assert_return (invoke "check_t1" (i32.const 6)) (i32.const 4))
(assert_trap (invoke "check_t1" (i32.const 7)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 8)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 9)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 10)) "uninitialized element")
(assert_return (invoke "check_t1" (i32.const 11)) (i32.const 6))
(assert_return (invoke "check_t1" (i32.const 12)) (i32.const 3))
(assert_return (invoke "check_t1" (i32.const 13)) (i32.const 2))
(assert_return (invoke "check_t1" (i32.const 14)) (i32.const 5))
(assert_return (invoke "check_t1" (i32.const 15)) (i32.const 7))
(assert_trap (invoke "check_t1" (i32.const 16)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 17)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 18)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 19)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 20)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 21)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 22)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 23)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 24)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 25)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 26)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 27)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 28)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 29)) "uninitialized element")

(module
  (type (func (result i32)))  ;; type #0
  (import "a" "ef0" (func (result i32)))    ;; index 0
  (import "a" "ef1" (func (result i32)))
  (import "a" "ef2" (func (result i32)))
  (import "a" "ef3" (func (result i32)))
  (import "a" "ef4" (func (result i32)))    ;; index 4
  (table $t0 30 30 funcref)
  (table $t1 30 30 funcref)
  (elem (table $t0) (i32.const 2) func 3 1 4 1)
  (elem funcref
    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))
  (elem (table $t0) (i32.const 12) func 7 5 2 3 6)
  (elem funcref
    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))
  (elem (table $t1) (i32.const 3) func 1 3 1 4)
  (elem (table $t1) (i32.const 11) func 6 3 2 5 7)
  (func (result i32) (i32.const 5))  ;; index 5
  (func (result i32) (i32.const 6))
  (func (result i32) (i32.const 7))
  (func (result i32) (i32.const 8))
  (func (result i32) (i32.const 9))  ;; index 9
  (func (export "test")
    (table.copy $t0 $t0 (i32.const 25) (i32.const 1) (i32.const 3)))
  (func (export "check_t0") (param i32) (result i32)
    (call_indirect $t0 (type 0) (local.get 0)))
  (func (export "check_t1") (param i32) (result i32)
    (call_indirect $t1 (type 0) (local.get 0)))
)

(invoke "test")
(assert_trap (invoke "check_t0" (i32.const 0)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 1)) "uninitialized element")
(assert_return (invoke "check_t0" (i32.const 2)) (i32.const 3))
(assert_return (invoke "check_t0" (i32.const 3)) (i32.const 1))
(assert_return (invoke "check_t0" (i32.const 4)) (i32.const 4))
(assert_return (invoke "check_t0" (i32.const 5)) (i32.const 1))
(assert_trap (invoke "check_t0" (i32.const 6)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 7)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 8)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 9)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 10)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 11)) "uninitialized element")
(assert_return (invoke "check_t0" (i32.const 12)) (i32.const 7))
(assert_return (invoke "check_t0" (i32.const 13)) (i32.const 5))
(assert_return (invoke "check_t0" (i32.const 14)) (i32.const 2))
(assert_return (invoke "check_t0" (i32.const 15)) (i32.const 3))
(assert_return (invoke "check_t0" (i32.const 16)) (i32.const 6))
(assert_trap (invoke "check_t0" (i32.const 17)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 18)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 19)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 20)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 21)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 22)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 23)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 24)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 25)) "uninitialized element")
(assert_return (invoke "check_t0" (i32.const 26)) (i32.const 3))
(assert_return (invoke "check_t0" (i32.const 27)) (i32.const 1))
(assert_trap (invoke "check_t0" (i32.const 28)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 29)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 0)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 1)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 2)) "uninitialized element")
(assert_return (invoke "check_t1" (i32.const 3)) (i32.const 1))
(assert_return (invoke "check_t1" (i32.const 4)) (i32.const 3))
(assert_return (invoke "check_t1" (i32.const 5)) (i32.const 1))
(assert_return (invoke "check_t1" (i32.const 6)) (i32.const 4))
(assert_trap (invoke "check_t1" (i32.const 7)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 8)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 9)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 10)) "uninitialized element")
(assert_return (invoke "check_t1" (i32.const 11)) (i32.const 6))
(assert_return (invoke "check_t1" (i32.const 12)) (i32.const 3))
(assert_return (invoke "check_t1" (i32.const 13)) (i32.const 2))
(assert_return (invoke "check_t1" (i32.const 14)) (i32.const 5))
(assert_return (invoke "check_t1" (i32.const 15)) (i32.const 7))
(assert_trap (invoke "check_t1" (i32.const 16)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 17)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 18)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 19)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 20)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 21)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 22)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 23)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 24)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 25)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 26)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 27)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 28)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 29)) "uninitialized element")

(module
  (type (func (result i32)))  ;; type #0
  (import "a" "ef0" (func (result i32)))    ;; index 0
  (import "a" "ef1" (func (result i32)))
  (import "a" "ef2" (func (result i32)))
  (import "a" "ef3" (func (result i32)))
  (import "a" "ef4" (func (result i32)))    ;; index 4
  (table $t0 30 30 funcref)
  (table $t1 30 30 funcref)
  (elem (table $t0) (i32.const 2) func 3 1 4 1)
  (elem funcref
    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))
  (elem (table $t0) (i32.const 12) func 7 5 2 3 6)
  (elem funcref
    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))
  (elem (table $t1) (i32.const 3) func 1 3 1 4)
  (elem (table $t1) (i32.const 11) func 6 3 2 5 7)
  (func (result i32) (i32.const 5))  ;; index 5
  (func (result i32) (i32.const 6))
  (func (result i32) (i32.const 7))
  (func (result i32) (i32.const 8))
  (func (result i32) (i32.const 9))  ;; index 9
  (func (export "test")
    (table.copy $t0 $t0 (i32.const 10) (i32.const 12) (i32.const 7)))
  (func (export "check_t0") (param i32) (result i32)
    (call_indirect $t0 (type 0) (local.get 0)))
  (func (export "check_t1") (param i32) (result i32)
    (call_indirect $t1 (type 0) (local.get 0)))
)

(invoke "test")
(assert_trap (invoke "check_t0" (i32.const 0)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 1)) "uninitialized element")
(assert_return (invoke "check_t0" (i32.const 2)) (i32.const 3))
(assert_return (invoke "check_t0" (i32.const 3)) (i32.const 1))
(assert_return (invoke "check_t0" (i32.const 4)) (i32.const 4))
(assert_return (invoke "check_t0" (i32.const 5)) (i32.const 1))
(assert_trap (invoke "check_t0" (i32.const 6)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 7)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 8)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 9)) "uninitialized element")
(assert_return (invoke "check_t0" (i32.const 10)) (i32.const 7))
(assert_return (invoke "check_t0" (i32.const 11)) (i32.const 5))
(assert_return (invoke "check_t0" (i32.const 12)) (i32.const 2))
(assert_return (invoke "check_t0" (i32.const 13)) (i32.const 3))
(assert_return (invoke "check_t0" (i32.const 14)) (i32.const 6))
(assert_trap (invoke "check_t0" (i32.const 15)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 16)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 17)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 18)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 19)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 20)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 21)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 22)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 23)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 24)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 25)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 26)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 27)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 28)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 29)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 0)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 1)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 2)) "uninitialized element")
(assert_return (invoke "check_t1" (i32.const 3)) (i32.const 1))
(assert_return (invoke "check_t1" (i32.const 4)) (i32.const 3))
(assert_return (invoke "check_t1" (i32.const 5)) (i32.const 1))
(assert_return (invoke "check_t1" (i32.const 6)) (i32.const 4))
(assert_trap (invoke "check_t1" (i32.const 7)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 8)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 9)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 10)) "uninitialized element")
(assert_return (invoke "check_t1" (i32.const 11)) (i32.const 6))
(assert_return (invoke "check_t1" (i32.const 12)) (i32.const 3))
(assert_return (invoke "check_t1" (i32.const 13)) (i32.const 2))
(assert_return (invoke "check_t1" (i32.const 14)) (i32.const 5))
(assert_return (invoke "check_t1" (i32.const 15)) (i32.const 7))
(assert_trap (invoke "check_t1" (i32.const 16)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 17)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 18)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 19)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 20)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 21)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 22)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 23)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 24)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 25)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 26)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 27)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 28)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 29)) "uninitialized element")

(module
  (type (func (result i32)))  ;; type #0
  (import "a" "ef0" (func (result i32)))    ;; index 0
  (import "a" "ef1" (func (result i32)))
  (import "a" "ef2" (func (result i32)))
  (import "a" "ef3" (func (result i32)))
  (import "a" "ef4" (func (result i32)))    ;; index 4
  (table $t0 30 30 funcref)
  (table $t1 30 30 funcref)
  (elem (table $t0) (i32.const 2) func 3 1 4 1)
  (elem funcref
    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))
  (elem (table $t0) (i32.const 12) func 7 5 2 3 6)
  (elem funcref
    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))
  (elem (table $t1) (i32.const 3) func 1 3 1 4)
  (elem (table $t1) (i32.const 11) func 6 3 2 5 7)
  (func (result i32) (i32.const 5))  ;; index 5
  (func (result i32) (i32.const 6))
  (func (result i32) (i32.const 7))
  (func (result i32) (i32.const 8))
  (func (result i32) (i32.const 9))  ;; index 9
  (func (export "test")
    (table.copy $t0 $t0 (i32.const 12) (i32.const 10) (i32.const 7)))
  (func (export "check_t0") (param i32) (result i32)
    (call_indirect $t0 (type 0) (local.get 0)))
  (func (export "check_t1") (param i32) (result i32)
    (call_indirect $t1 (type 0) (local.get 0)))
)

(invoke "test")
(assert_trap (invoke "check_t0" (i32.const 0)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 1)) "uninitialized element")
(assert_return (invoke "check_t0" (i32.const 2)) (i32.const 3))
(assert_return (invoke "check_t0" (i32.const 3)) (i32.const 1))
(assert_return (invoke "check_t0" (i32.const 4)) (i32.const 4))
(assert_return (invoke "check_t0" (i32.const 5)) (i32.const 1))
(assert_trap (invoke "check_t0" (i32.const 6)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 7)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 8)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 9)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 10)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 11)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 12)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 13)) "uninitialized element")
(assert_return (invoke "check_t0" (i32.const 14)) (i32.const 7))
(assert_return (invoke "check_t0" (i32.const 15)) (i32.const 5))
(assert_return (invoke "check_t0" (i32.const 16)) (i32.const 2))
(assert_return (invoke "check_t0" (i32.const 17)) (i32.const 3))
(assert_return (invoke "check_t0" (i32.const 18)) (i32.const 6))
(assert_trap (invoke "check_t0" (i32.const 19)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 20)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 21)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 22)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 23)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 24)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 25)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 26)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 27)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 28)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 29)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 0)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 1)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 2)) "uninitialized element")
(assert_return (invoke "check_t1" (i32.const 3)) (i32.const 1))
(assert_return (invoke "check_t1" (i32.const 4)) (i32.const 3))
(assert_return (invoke "check_t1" (i32.const 5)) (i32.const 1))
(assert_return (invoke "check_t1" (i32.const 6)) (i32.const 4))
(assert_trap (invoke "check_t1" (i32.const 7)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 8)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 9)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 10)) "uninitialized element")
(assert_return (invoke "check_t1" (i32.const 11)) (i32.const 6))
(assert_return (invoke "check_t1" (i32.const 12)) (i32.const 3))
(assert_return (invoke "check_t1" (i32.const 13)) (i32.const 2))
(assert_return (invoke "check_t1" (i32.const 14)) (i32.const 5))
(assert_return (invoke "check_t1" (i32.const 15)) (i32.const 7))
(assert_trap (invoke "check_t1" (i32.const 16)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 17)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 18)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 19)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 20)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 21)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 22)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 23)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 24)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 25)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 26)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 27)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 28)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 29)) "uninitialized element")

(module
  (type (func (result i32)))  ;; type #0
  (import "a" "ef0" (func (result i32)))    ;; index 0
  (import "a" "ef1" (func (result i32)))
  (import "a" "ef2" (func (result i32)))
  (import "a" "ef3" (func (result i32)))
  (import "a" "ef4" (func (result i32)))    ;; index 4
  (table $t0 30 30 funcref)
  (table $t1 30 30 funcref)
  (elem (table $t0) (i32.const 2) func 3 1 4 1)
  (elem funcref
    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))
  (elem (table $t0) (i32.const 12) func 7 5 2 3 6)
  (elem funcref
    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))
  (elem (table $t1) (i32.const 3) func 1 3 1 4)
  (elem (table $t1) (i32.const 11) func 6 3 2 5 7)
  (func (result i32) (i32.const 5))  ;; index 5
  (func (result i32) (i32.const 6))
  (func (result i32) (i32.const 7))
  (func (result i32) (i32.const 8))
  (func (result i32) (i32.const 9))  ;; index 9
  (func (export "test")
    (table.copy $t1 $t0 (i32.const 10) (i32.const 0) (i32.const 20)))
  (func (export "check_t0") (param i32) (result i32)
    (call_indirect $t0 (type 0) (local.get 0)))
  (func (export "check_t1") (param i32) (result i32)
    (call_indirect $t1 (type 0) (local.get 0)))
)

(invoke "test")
(assert_trap (invoke "check_t0" (i32.const 0)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 1)) "uninitialized element")
(assert_return (invoke "check_t0" (i32.const 2)) (i32.const 3))
(assert_return (invoke "check_t0" (i32.const 3)) (i32.const 1))
(assert_return (invoke "check_t0" (i32.const 4)) (i32.const 4))
(assert_return (invoke "check_t0" (i32.const 5)) (i32.const 1))
(assert_trap (invoke "check_t0" (i32.const 6)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 7)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 8)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 9)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 10)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 11)) "uninitialized element")
(assert_return (invoke "check_t0" (i32.const 12)) (i32.const 7))
(assert_return (invoke "check_t0" (i32.const 13)) (i32.const 5))
(assert_return (invoke "check_t0" (i32.const 14)) (i32.const 2))
(assert_return (invoke "check_t0" (i32.const 15)) (i32.const 3))
(assert_return (invoke "check_t0" (i32.const 16)) (i32.const 6))
(assert_trap (invoke "check_t0" (i32.const 17)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 18)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 19)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 20)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 21)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 22)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 23)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 24)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 25)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 26)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 27)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 28)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 29)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 0)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 1)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 2)) "uninitialized element")
(assert_return (invoke "check_t1" (i32.const 3)) (i32.const 1))
(assert_return (invoke "check_t1" (i32.const 4)) (i32.const 3))
(assert_return (invoke "check_t1" (i32.const 5)) (i32.const 1))
(assert_return (invoke "check_t1" (i32.const 6)) (i32.const 4))
(assert_trap (invoke "check_t1" (i32.const 7)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 8)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 9)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 10)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 11)) "uninitialized element")
(assert_return (invoke "check_t1" (i32.const 12)) (i32.const 3))
(assert_return (invoke "check_t1" (i32.const 13)) (i32.const 1))
(assert_return (invoke "check_t1" (i32.const 14)) (i32.const 4))
(assert_return (invoke "check_t1" (i32.const 15)) (i32.const 1))
(assert_trap (invoke "check_t1" (i32.const 16)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 17)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 18)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 19)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 20)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 21)) "uninitialized element")
(assert_return (invoke "check_t1" (i32.const 22)) (i32.const 7))
(assert_return (invoke "check_t1" (i32.const 23)) (i32.const 5))
(assert_return (invoke "check_t1" (i32.const 24)) (i32.const 2))
(assert_return (invoke "check_t1" (i32.const 25)) (i32.const 3))
(assert_return (invoke "check_t1" (i32.const 26)) (i32.const 6))
(assert_trap (invoke "check_t1" (i32.const 27)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 28)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 29)) "uninitialized element")

(module
  (type (func (result i32)))  ;; type #0
  (import "a" "ef0" (func (result i32)))    ;; index 0
  (import "a" "ef1" (func (result i32)))
  (import "a" "ef2" (func (result i32)))
  (import "a" "ef3" (func (result i32)))
  (import "a" "ef4" (func (result i32)))    ;; index 4
  (table $t0 30 30 funcref)
  (table $t1 30 30 funcref)
  (elem (table $t1) (i32.const 2) func 3 1 4 1)
  (elem funcref
    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))
  (elem (table $t1) (i32.const 12) func 7 5 2 3 6)
  (elem funcref
    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))
  (elem (table $t0) (i32.const 3) func 1 3 1 4)
  (elem (table $t0) (i32.const 11) func 6 3 2 5 7)
  (func (result i32) (i32.const 5))  ;; index 5
  (func (result i32) (i32.const 6))
  (func (result i32) (i32.const 7))
  (func (result i32) (i32.const 8))
  (func (result i32) (i32.const 9))  ;; index 9
  (func (export "test")
    (nop))
  (func (export "check_t0") (param i32) (result i32)
    (call_indirect $t1 (type 0) (local.get 0)))
  (func (export "check_t1") (param i32) (result i32)
    (call_indirect $t0 (type 0) (local.get 0)))
)

(invoke "test")
(assert_trap (invoke "check_t0" (i32.const 0)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 1)) "uninitialized element")
(assert_return (invoke "check_t0" (i32.const 2)) (i32.const 3))
(assert_return (invoke "check_t0" (i32.const 3)) (i32.const 1))
(assert_return (invoke "check_t0" (i32.const 4)) (i32.const 4))
(assert_return (invoke "check_t0" (i32.const 5)) (i32.const 1))
(assert_trap (invoke "check_t0" (i32.const 6)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 7)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 8)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 9)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 10)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 11)) "uninitialized element")
(assert_return (invoke "check_t0" (i32.const 12)) (i32.const 7))
(assert_return (invoke "check_t0" (i32.const 13)) (i32.const 5))
(assert_return (invoke "check_t0" (i32.const 14)) (i32.const 2))
(assert_return (invoke "check_t0" (i32.const 15)) (i32.const 3))
(assert_return (invoke "check_t0" (i32.const 16)) (i32.const 6))
(assert_trap (invoke "check_t0" (i32.const 17)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 18)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 19)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 20)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 21)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 22)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 23)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 24)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 25)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 26)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 27)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 28)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 29)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 0)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 1)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 2)) "uninitialized element")
(assert_return (invoke "check_t1" (i32.const 3)) (i32.const 1))
(assert_return (invoke "check_t1" (i32.const 4)) (i32.const 3))
(assert_return (invoke "check_t1" (i32.const 5)) (i32.const 1))
(assert_return (invoke "check_t1" (i32.const 6)) (i32.const 4))
(assert_trap (invoke "check_t1" (i32.const 7)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 8)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 9)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 10)) "uninitialized element")
(assert_return (invoke "check_t1" (i32.const 11)) (i32.const 6))
(assert_return (invoke "check_t1" (i32.const 12)) (i32.const 3))
(assert_return (invoke "check_t1" (i32.const 13)) (i32.const 2))
(assert_return (invoke "check_t1" (i32.const 14)) (i32.const 5))
(assert_return (invoke "check_t1" (i32.const 15)) (i32.const 7))
(assert_trap (invoke "check_t1" (i32.const 16)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 17)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 18)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 19)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 20)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 21)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 22)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 23)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 24)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 25)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 26)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 27)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 28)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 29)) "uninitialized element")

(module
  (type (func (result i32)))  ;; type #0
  (import "a" "ef0" (func (result i32)))    ;; index 0
  (import "a" "ef1" (func (result i32)))
  (import "a" "ef2" (func (result i32)))
  (import "a" "ef3" (func (result i32)))
  (import "a" "ef4" (func (result i32)))    ;; index 4
  (table $t0 30 30 funcref)
  (table $t1 30 30 funcref)
  (elem (table $t1) (i32.const 2) func 3 1 4 1)
  (elem funcref
    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))
  (elem (table $t1) (i32.const 12) func 7 5 2 3 6)
  (elem funcref
    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))
  (elem (table $t0) (i32.const 3) func 1 3 1 4)
  (elem (table $t0) (i32.const 11) func 6 3 2 5 7)
  (func (result i32) (i32.const 5))  ;; index 5
  (func (result i32) (i32.const 6))
  (func (result i32) (i32.const 7))
  (func (result i32) (i32.const 8))
  (func (result i32) (i32.const 9))  ;; index 9
  (func (export "test")
    (table.copy $t1 $t1 (i32.const 13) (i32.const 2) (i32.const 3)))
  (func (export "check_t0") (param i32) (result i32)
    (call_indirect $t1 (type 0) (local.get 0)))
  (func (export "check_t1") (param i32) (result i32)
    (call_indirect $t0 (type 0) (local.get 0)))
)

(invoke "test")
(assert_trap (invoke "check_t0" (i32.const 0)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 1)) "uninitialized element")
(assert_return (invoke "check_t0" (i32.const 2)) (i32.const 3))
(assert_return (invoke "check_t0" (i32.const 3)) (i32.const 1))
(assert_return (invoke "check_t0" (i32.const 4)) (i32.const 4))
(assert_return (invoke "check_t0" (i32.const 5)) (i32.const 1))
(assert_trap (invoke "check_t0" (i32.const 6)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 7)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 8)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 9)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 10)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 11)) "uninitialized element")
(assert_return (invoke "check_t0" (i32.const 12)) (i32.const 7))
(assert_return (invoke "check_t0" (i32.const 13)) (i32.const 3))
(assert_return (invoke "check_t0" (i32.const 14)) (i32.const 1))
(assert_return (invoke "check_t0" (i32.const 15)) (i32.const 4))
(assert_return (invoke "check_t0" (i32.const 16)) (i32.const 6))
(assert_trap (invoke "check_t0" (i32.const 17)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 18)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 19)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 20)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 21)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 22)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 23)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 24)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 25)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 26)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 27)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 28)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 29)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 0)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 1)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 2)) "uninitialized element")
(assert_return (invoke "check_t1" (i32.const 3)) (i32.const 1))
(assert_return (invoke "check_t1" (i32.const 4)) (i32.const 3))
(assert_return (invoke "check_t1" (i32.const 5)) (i32.const 1))
(assert_return (invoke "check_t1" (i32.const 6)) (i32.const 4))
(assert_trap (invoke "check_t1" (i32.const 7)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 8)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 9)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 10)) "uninitialized element")
(assert_return (invoke "check_t1" (i32.const 11)) (i32.const 6))
(assert_return (invoke "check_t1" (i32.const 12)) (i32.const 3))
(assert_return (invoke "check_t1" (i32.const 13)) (i32.const 2))
(assert_return (invoke "check_t1" (i32.const 14)) (i32.const 5))
(assert_return (invoke "check_t1" (i32.const 15)) (i32.const 7))
(assert_trap (invoke "check_t1" (i32.const 16)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 17)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 18)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 19)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 20)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 21)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 22)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 23)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 24)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 25)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 26)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 27)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 28)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 29)) "uninitialized element")

(module
  (type (func (result i32)))  ;; type #0
  (import "a" "ef0" (func (result i32)))    ;; index 0
  (import "a" "ef1" (func (result i32)))
  (import "a" "ef2" (func (result i32)))
  (import "a" "ef3" (func (result i32)))
  (import "a" "ef4" (func (result i32)))    ;; index 4
  (table $t0 30 30 funcref)
  (table $t1 30 30 funcref)
  (elem (table $t1) (i32.const 2) func 3 1 4 1)
  (elem funcref
    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))
  (elem (table $t1) (i32.const 12) func 7 5 2 3 6)
  (elem funcref
    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))
  (elem (table $t0) (i32.const 3) func 1 3 1 4)
  (elem (table $t0) (i32.const 11) func 6 3 2 5 7)
  (func (result i32) (i32.const 5))  ;; index 5
  (func (result i32) (i32.const 6))
  (func (result i32) (i32.const 7))
  (func (result i32) (i32.const 8))
  (func (result i32) (i32.const 9))  ;; index 9
  (func (export "test")
    (table.copy $t1 $t1 (i32.const 25) (i32.const 15) (i32.const 2)))
  (func (export "check_t0") (param i32) (result i32)
    (call_indirect $t1 (type 0) (local.get 0)))
  (func (export "check_t1") (param i32) (result i32)
    (call_indirect $t0 (type 0) (local.get 0)))
)

(invoke "test")
(assert_trap (invoke "check_t0" (i32.const 0)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 1)) "uninitialized element")
(assert_return (invoke "check_t0" (i32.const 2)) (i32.const 3))
(assert_return (invoke "check_t0" (i32.const 3)) (i32.const 1))
(assert_return (invoke "check_t0" (i32.const 4)) (i32.const 4))
(assert_return (invoke "check_t0" (i32.const 5)) (i32.const 1))
(assert_trap (invoke "check_t0" (i32.const 6)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 7)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 8)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 9)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 10)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 11)) "uninitialized element")
(assert_return (invoke "check_t0" (i32.const 12)) (i32.const 7))
(assert_return (invoke "check_t0" (i32.const 13)) (i32.const 5))
(assert_return (invoke "check_t0" (i32.const 14)) (i32.const 2))
(assert_return (invoke "check_t0" (i32.const 15)) (i32.const 3))
(assert_return (invoke "check_t0" (i32.const 16)) (i32.const 6))
(assert_trap (invoke "check_t0" (i32.const 17)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 18)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 19)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 20)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 21)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 22)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 23)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 24)) "uninitialized element")
(assert_return (invoke "check_t0" (i32.const 25)) (i32.const 3))
(assert_return (invoke "check_t0" (i32.const 26)) (i32.const 6))
(assert_trap (invoke "check_t0" (i32.const 27)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 28)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 29)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 0)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 1)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 2)) "uninitialized element")
(assert_return (invoke "check_t1" (i32.const 3)) (i32.const 1))
(assert_return (invoke "check_t1" (i32.const 4)) (i32.const 3))
(assert_return (invoke "check_t1" (i32.const 5)) (i32.const 1))
(assert_return (invoke "check_t1" (i32.const 6)) (i32.const 4))
(assert_trap (invoke "check_t1" (i32.const 7)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 8)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 9)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 10)) "uninitialized element")
(assert_return (invoke "check_t1" (i32.const 11)) (i32.const 6))
(assert_return (invoke "check_t1" (i32.const 12)) (i32.const 3))
(assert_return (invoke "check_t1" (i32.const 13)) (i32.const 2))
(assert_return (invoke "check_t1" (i32.const 14)) (i32.const 5))
(assert_return (invoke "check_t1" (i32.const 15)) (i32.const 7))
(assert_trap (invoke "check_t1" (i32.const 16)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 17)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 18)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 19)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 20)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 21)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 22)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 23)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 24)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 25)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 26)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 27)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 28)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 29)) "uninitialized element")

(module
  (type (func (result i32)))  ;; type #0
  (import "a" "ef0" (func (result i32)))    ;; index 0
  (import "a" "ef1" (func (result i32)))
  (import "a" "ef2" (func (result i32)))
  (import "a" "ef3" (func (result i32)))
  (import "a" "ef4" (func (result i32)))    ;; index 4
  (table $t0 30 30 funcref)
  (table $t1 30 30 funcref)
  (elem (table $t1) (i32.const 2) func 3 1 4 1)
  (elem funcref
    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))
  (elem (table $t1) (i32.const 12) func 7 5 2 3 6)
  (elem funcref
    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))
  (elem (table $t0) (i32.const 3) func 1 3 1 4)
  (elem (table $t0) (i32.const 11) func 6 3 2 5 7)
  (func (result i32) (i32.const 5))  ;; index 5
  (func (result i32) (i32.const 6))
  (func (result i32) (i32.const 7))
  (func (result i32) (i32.const 8))
  (func (result i32) (i32.const 9))  ;; index 9
  (func (export "test")
    (table.copy $t1 $t1 (i32.const 13) (i32.const 25) (i32.const 3)))
  (func (export "check_t0") (param i32) (result i32)
    (call_indirect $t1 (type 0) (local.get 0)))
  (func (export "check_t1") (param i32) (result i32)
    (call_indirect $t0 (type 0) (local.get 0)))
)

(invoke "test")
(assert_trap (invoke "check_t0" (i32.const 0)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 1)) "uninitialized element")
(assert_return (invoke "check_t0" (i32.const 2)) (i32.const 3))
(assert_return (invoke "check_t0" (i32.const 3)) (i32.const 1))
(assert_return (invoke "check_t0" (i32.const 4)) (i32.const 4))
(assert_return (invoke "check_t0" (i32.const 5)) (i32.const 1))
(assert_trap (invoke "check_t0" (i32.const 6)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 7)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 8)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 9)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 10)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 11)) "uninitialized element")
(assert_return (invoke "check_t0" (i32.const 12)) (i32.const 7))
(assert_trap (invoke "check_t0" (i32.const 13)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 14)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 15)) "uninitialized element")
(assert_return (invoke "check_t0" (i32.const 16)) (i32.const 6))
(assert_trap (invoke "check_t0" (i32.const 17)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 18)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 19)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 20)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 21)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 22)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 23)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 24)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 25)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 26)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 27)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 28)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 29)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 0)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 1)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 2)) "uninitialized element")
(assert_return (invoke "check_t1" (i32.const 3)) (i32.const 1))
(assert_return (invoke "check_t1" (i32.const 4)) (i32.const 3))
(assert_return (invoke "check_t1" (i32.const 5)) (i32.const 1))
(assert_return (invoke "check_t1" (i32.const 6)) (i32.const 4))
(assert_trap (invoke "check_t1" (i32.const 7)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 8)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 9)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 10)) "uninitialized element")
(assert_return (invoke "check_t1" (i32.const 11)) (i32.const 6))
(assert_return (invoke "check_t1" (i32.const 12)) (i32.const 3))
(assert_return (invoke "check_t1" (i32.const 13)) (i32.const 2))
(assert_return (invoke "check_t1" (i32.const 14)) (i32.const 5))
(assert_return (invoke "check_t1" (i32.const 15)) (i32.const 7))
(assert_trap (invoke "check_t1" (i32.const 16)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 17)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 18)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 19)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 20)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 21)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 22)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 23)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 24)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 25)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 26)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 27)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 28)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 29)) "uninitialized element")

(module
  (type (func (result i32)))  ;; type #0
  (import "a" "ef0" (func (result i32)))    ;; index 0
  (import "a" "ef1" (func (result i32)))
  (import "a" "ef2" (func (result i32)))
  (import "a" "ef3" (func (result i32)))
  (import "a" "ef4" (func (result i32)))    ;; index 4
  (table $t0 30 30 funcref)
  (table $t1 30 30 funcref)
  (elem (table $t1) (i32.const 2) func 3 1 4 1)
  (elem funcref
    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))
  (elem (table $t1) (i32.const 12) func 7 5 2 3 6)
  (elem funcref
    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))
  (elem (table $t0) (i32.const 3) func 1 3 1 4)
  (elem (table $t0) (i32.const 11) func 6 3 2 5 7)
  (func (result i32) (i32.const 5))  ;; index 5
  (func (result i32) (i32.const 6))
  (func (result i32) (i32.const 7))
  (func (result i32) (i32.const 8))
  (func (result i32) (i32.const 9))  ;; index 9
  (func (export "test")
    (table.copy $t1 $t1 (i32.const 20) (i32.const 22) (i32.const 4)))
  (func (export "check_t0") (param i32) (result i32)
    (call_indirect $t1 (type 0) (local.get 0)))
  (func (export "check_t1") (param i32) (result i32)
    (call_indirect $t0 (type 0) (local.get 0)))
)

(invoke "test")
(assert_trap (invoke "check_t0" (i32.const 0)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 1)) "uninitialized element")
(assert_return (invoke "check_t0" (i32.const 2)) (i32.const 3))
(assert_return (invoke "check_t0" (i32.const 3)) (i32.const 1))
(assert_return (invoke "check_t0" (i32.const 4)) (i32.const 4))
(assert_return (invoke "check_t0" (i32.const 5)) (i32.const 1))
(assert_trap (invoke "check_t0" (i32.const 6)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 7)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 8)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 9)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 10)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 11)) "uninitialized element")
(assert_return (invoke "check_t0" (i32.const 12)) (i32.const 7))
(assert_return (invoke "check_t0" (i32.const 13)) (i32.const 5))
(assert_return (invoke "check_t0" (i32.const 14)) (i32.const 2))
(assert_return (invoke "check_t0" (i32.const 15)) (i32.const 3))
(assert_return (invoke "check_t0" (i32.const 16)) (i32.const 6))
(assert_trap (invoke "check_t0" (i32.const 17)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 18)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 19)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 20)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 21)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 22)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 23)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 24)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 25)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 26)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 27)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 28)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 29)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 0)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 1)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 2)) "uninitialized element")
(assert_return (invoke "check_t1" (i32.const 3)) (i32.const 1))
(assert_return (invoke "check_t1" (i32.const 4)) (i32.const 3))
(assert_return (invoke "check_t1" (i32.const 5)) (i32.const 1))
(assert_return (invoke "check_t1" (i32.const 6)) (i32.const 4))
(assert_trap (invoke "check_t1" (i32.const 7)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 8)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 9)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 10)) "uninitialized element")
(assert_return (invoke "check_t1" (i32.const 11)) (i32.const 6))
(assert_return (invoke "check_t1" (i32.const 12)) (i32.const 3))
(assert_return (invoke "check_t1" (i32.const 13)) (i32.const 2))
(assert_return (invoke "check_t1" (i32.const 14)) (i32.const 5))
(assert_return (invoke "check_t1" (i32.const 15)) (i32.const 7))
(assert_trap (invoke "check_t1" (i32.const 16)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 17)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 18)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 19)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 20)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 21)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 22)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 23)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 24)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 25)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 26)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 27)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 28)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 29)) "uninitialized element")

(module
  (type (func (result i32)))  ;; type #0
  (import "a" "ef0" (func (result i32)))    ;; index 0
  (import "a" "ef1" (func (result i32)))
  (import "a" "ef2" (func (result i32)))
  (import "a" "ef3" (func (result i32)))
  (import "a" "ef4" (func (result i32)))    ;; index 4
  (table $t0 30 30 funcref)
  (table $t1 30 30 funcref)
  (elem (table $t1) (i32.const 2) func 3 1 4 1)
  (elem funcref
    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))
  (elem (table $t1) (i32.const 12) func 7 5 2 3 6)
  (elem funcref
    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))
  (elem (table $t0) (i32.const 3) func 1 3 1 4)
  (elem (table $t0) (i32.const 11) func 6 3 2 5 7)
  (func (result i32) (i32.const 5))  ;; index 5
  (func (result i32) (i32.const 6))
  (func (result i32) (i32.const 7))
  (func (result i32) (i32.const 8))
  (func (result i32) (i32.const 9))  ;; index 9
  (func (export "test")
    (table.copy $t1 $t1 (i32.const 25) (i32.const 1) (i32.const 3)))
  (func (export "check_t0") (param i32) (result i32)
    (call_indirect $t1 (type 0) (local.get 0)))
  (func (export "check_t1") (param i32) (result i32)
    (call_indirect $t0 (type 0) (local.get 0)))
)

(invoke "test")
(assert_trap (invoke "check_t0" (i32.const 0)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 1)) "uninitialized element")
(assert_return (invoke "check_t0" (i32.const 2)) (i32.const 3))
(assert_return (invoke "check_t0" (i32.const 3)) (i32.const 1))
(assert_return (invoke "check_t0" (i32.const 4)) (i32.const 4))
(assert_return (invoke "check_t0" (i32.const 5)) (i32.const 1))
(assert_trap (invoke "check_t0" (i32.const 6)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 7)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 8)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 9)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 10)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 11)) "uninitialized element")
(assert_return (invoke "check_t0" (i32.const 12)) (i32.const 7))
(assert_return (invoke "check_t0" (i32.const 13)) (i32.const 5))
(assert_return (invoke "check_t0" (i32.const 14)) (i32.const 2))
(assert_return (invoke "check_t0" (i32.const 15)) (i32.const 3))
(assert_return (invoke "check_t0" (i32.const 16)) (i32.const 6))
(assert_trap (invoke "check_t0" (i32.const 17)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 18)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 19)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 20)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 21)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 22)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 23)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 24)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 25)) "uninitialized element")
(assert_return (invoke "check_t0" (i32.const 26)) (i32.const 3))
(assert_return (invoke "check_t0" (i32.const 27)) (i32.const 1))
(assert_trap (invoke "check_t0" (i32.const 28)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 29)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 0)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 1)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 2)) "uninitialized element")
(assert_return (invoke "check_t1" (i32.const 3)) (i32.const 1))
(assert_return (invoke "check_t1" (i32.const 4)) (i32.const 3))
(assert_return (invoke "check_t1" (i32.const 5)) (i32.const 1))
(assert_return (invoke "check_t1" (i32.const 6)) (i32.const 4))
(assert_trap (invoke "check_t1" (i32.const 7)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 8)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 9)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 10)) "uninitialized element")
(assert_return (invoke "check_t1" (i32.const 11)) (i32.const 6))
(assert_return (invoke "check_t1" (i32.const 12)) (i32.const 3))
(assert_return (invoke "check_t1" (i32.const 13)) (i32.const 2))
(assert_return (invoke "check_t1" (i32.const 14)) (i32.const 5))
(assert_return (invoke "check_t1" (i32.const 15)) (i32.const 7))
(assert_trap (invoke "check_t1" (i32.const 16)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 17)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 18)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 19)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 20)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 21)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 22)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 23)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 24)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 25)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 26)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 27)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 28)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 29)) "uninitialized element")

(module
  (type (func (result i32)))  ;; type #0
  (import "a" "ef0" (func (result i32)))    ;; index 0
  (import "a" "ef1" (func (result i32)))
  (import "a" "ef2" (func (result i32)))
  (import "a" "ef3" (func (result i32)))
  (import "a" "ef4" (func (result i32)))    ;; index 4
  (table $t0 30 30 funcref)
  (table $t1 30 30 funcref)
  (elem (table $t1) (i32.const 2) func 3 1 4 1)
  (elem funcref
    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))
  (elem (table $t1) (i32.const 12) func 7 5 2 3 6)
  (elem funcref
    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))
  (elem (table $t0) (i32.const 3) func 1 3 1 4)
  (elem (table $t0) (i32.const 11) func 6 3 2 5 7)
  (func (result i32) (i32.const 5))  ;; index 5
  (func (result i32) (i32.const 6))
  (func (result i32) (i32.const 7))
  (func (result i32) (i32.const 8))
  (func (result i32) (i32.const 9))  ;; index 9
  (func (export "test")
    (table.copy $t1 $t1 (i32.const 10) (i32.const 12) (i32.const 7)))
  (func (export "check_t0") (param i32) (result i32)
    (call_indirect $t1 (type 0) (local.get 0)))
  (func (export "check_t1") (param i32) (result i32)
    (call_indirect $t0 (type 0) (local.get 0)))
)

(invoke "test")
(assert_trap (invoke "check_t0" (i32.const 0)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 1)) "uninitialized element")
(assert_return (invoke "check_t0" (i32.const 2)) (i32.const 3))
(assert_return (invoke "check_t0" (i32.const 3)) (i32.const 1))
(assert_return (invoke "check_t0" (i32.const 4)) (i32.const 4))
(assert_return (invoke "check_t0" (i32.const 5)) (i32.const 1))
(assert_trap (invoke "check_t0" (i32.const 6)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 7)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 8)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 9)) "uninitialized element")
(assert_return (invoke "check_t0" (i32.const 10)) (i32.const 7))
(assert_return (invoke "check_t0" (i32.const 11)) (i32.const 5))
(assert_return (invoke "check_t0" (i32.const 12)) (i32.const 2))
(assert_return (invoke "check_t0" (i32.const 13)) (i32.const 3))
(assert_return (invoke "check_t0" (i32.const 14)) (i32.const 6))
(assert_trap (invoke "check_t0" (i32.const 15)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 16)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 17)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 18)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 19)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 20)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 21)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 22)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 23)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 24)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 25)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 26)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 27)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 28)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 29)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 0)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 1)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 2)) "uninitialized element")
(assert_return (invoke "check_t1" (i32.const 3)) (i32.const 1))
(assert_return (invoke "check_t1" (i32.const 4)) (i32.const 3))
(assert_return (invoke "check_t1" (i32.const 5)) (i32.const 1))
(assert_return (invoke "check_t1" (i32.const 6)) (i32.const 4))
(assert_trap (invoke "check_t1" (i32.const 7)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 8)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 9)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 10)) "uninitialized element")
(assert_return (invoke "check_t1" (i32.const 11)) (i32.const 6))
(assert_return (invoke "check_t1" (i32.const 12)) (i32.const 3))
(assert_return (invoke "check_t1" (i32.const 13)) (i32.const 2))
(assert_return (invoke "check_t1" (i32.const 14)) (i32.const 5))
(assert_return (invoke "check_t1" (i32.const 15)) (i32.const 7))
(assert_trap (invoke "check_t1" (i32.const 16)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 17)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 18)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 19)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 20)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 21)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 22)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 23)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 24)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 25)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 26)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 27)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 28)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 29)) "uninitialized element")

(module
  (type (func (result i32)))  ;; type #0
  (import "a" "ef0" (func (result i32)))    ;; index 0
  (import "a" "ef1" (func (result i32)))
  (import "a" "ef2" (func (result i32)))
  (import "a" "ef3" (func (result i32)))
  (import "a" "ef4" (func (result i32)))    ;; index 4
  (table $t0 30 30 funcref)
  (table $t1 30 30 funcref)
  (elem (table $t1) (i32.const 2) func 3 1 4 1)
  (elem funcref
    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))
  (elem (table $t1) (i32.const 12) func 7 5 2 3 6)
  (elem funcref
    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))
  (elem (table $t0) (i32.const 3) func 1 3 1 4)
  (elem (table $t0) (i32.const 11) func 6 3 2 5 7)
  (func (result i32) (i32.const 5))  ;; index 5
  (func (result i32) (i32.const 6))
  (func (result i32) (i32.const 7))
  (func (result i32) (i32.const 8))
  (func (result i32) (i32.const 9))  ;; index 9
  (func (export "test")
    (table.copy $t1 $t1 (i32.const 12) (i32.const 10) (i32.const 7)))
  (func (export "check_t0") (param i32) (result i32)
    (call_indirect $t1 (type 0) (local.get 0)))
  (func (export "check_t1") (param i32) (result i32)
    (call_indirect $t0 (type 0) (local.get 0)))
)

(invoke "test")
(assert_trap (invoke "check_t0" (i32.const 0)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 1)) "uninitialized element")
(assert_return (invoke "check_t0" (i32.const 2)) (i32.const 3))
(assert_return (invoke "check_t0" (i32.const 3)) (i32.const 1))
(assert_return (invoke "check_t0" (i32.const 4)) (i32.const 4))
(assert_return (invoke "check_t0" (i32.const 5)) (i32.const 1))
(assert_trap (invoke "check_t0" (i32.const 6)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 7)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 8)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 9)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 10)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 11)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 12)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 13)) "uninitialized element")
(assert_return (invoke "check_t0" (i32.const 14)) (i32.const 7))
(assert_return (invoke "check_t0" (i32.const 15)) (i32.const 5))
(assert_return (invoke "check_t0" (i32.const 16)) (i32.const 2))
(assert_return (invoke "check_t0" (i32.const 17)) (i32.const 3))
(assert_return (invoke "check_t0" (i32.const 18)) (i32.const 6))
(assert_trap (invoke "check_t0" (i32.const 19)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 20)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 21)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 22)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 23)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 24)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 25)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 26)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 27)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 28)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 29)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 0)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 1)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 2)) "uninitialized element")
(assert_return (invoke "check_t1" (i32.const 3)) (i32.const 1))
(assert_return (invoke "check_t1" (i32.const 4)) (i32.const 3))
(assert_return (invoke "check_t1" (i32.const 5)) (i32.const 1))
(assert_return (invoke "check_t1" (i32.const 6)) (i32.const 4))
(assert_trap (invoke "check_t1" (i32.const 7)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 8)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 9)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 10)) "uninitialized element")
(assert_return (invoke "check_t1" (i32.const 11)) (i32.const 6))
(assert_return (invoke "check_t1" (i32.const 12)) (i32.const 3))
(assert_return (invoke "check_t1" (i32.const 13)) (i32.const 2))
(assert_return (invoke "check_t1" (i32.const 14)) (i32.const 5))
(assert_return (invoke "check_t1" (i32.const 15)) (i32.const 7))
(assert_trap (invoke "check_t1" (i32.const 16)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 17)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 18)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 19)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 20)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 21)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 22)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 23)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 24)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 25)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 26)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 27)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 28)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 29)) "uninitialized element")

(module
  (type (func (result i32)))  ;; type #0
  (import "a" "ef0" (func (result i32)))    ;; index 0
  (import "a" "ef1" (func (result i32)))
  (import "a" "ef2" (func (result i32)))
  (import "a" "ef3" (func (result i32)))
  (import "a" "ef4" (func (result i32)))    ;; index 4
  (table $t0 30 30 funcref)
  (table $t1 30 30 funcref)
  (elem (table $t1) (i32.const 2) func 3 1 4 1)
  (elem funcref
    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))
  (elem (table $t1) (i32.const 12) func 7 5 2 3 6)
  (elem funcref
    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))
  (elem (table $t0) (i32.const 3) func 1 3 1 4)
  (elem (table $t0) (i32.const 11) func 6 3 2 5 7)
  (func (result i32) (i32.const 5))  ;; index 5
  (func (result i32) (i32.const 6))
  (func (result i32) (i32.const 7))
  (func (result i32) (i32.const 8))
  (func (result i32) (i32.const 9))  ;; index 9
  (func (export "test")
    (table.copy $t0 $t1 (i32.const 10) (i32.const 0) (i32.const 20)))
  (func (export "check_t0") (param i32) (result i32)
    (call_indirect $t1 (type 0) (local.get 0)))
  (func (export "check_t1") (param i32) (result i32)
    (call_indirect $t0 (type 0) (local.get 0)))
)

(invoke "test")
(assert_trap (invoke "check_t0" (i32.const 0)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 1)) "uninitialized element")
(assert_return (invoke "check_t0" (i32.const 2)) (i32.const 3))
(assert_return (invoke "check_t0" (i32.const 3)) (i32.const 1))
(assert_return (invoke "check_t0" (i32.const 4)) (i32.const 4))
(assert_return (invoke "check_t0" (i32.const 5)) (i32.const 1))
(assert_trap (invoke "check_t0" (i32.const 6)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 7)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 8)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 9)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 10)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 11)) "uninitialized element")
(assert_return (invoke "check_t0" (i32.const 12)) (i32.const 7))
(assert_return (invoke "check_t0" (i32.const 13)) (i32.const 5))
(assert_return (invoke "check_t0" (i32.const 14)) (i32.const 2))
(assert_return (invoke "check_t0" (i32.const 15)) (i32.const 3))
(assert_return (invoke "check_t0" (i32.const 16)) (i32.const 6))
(assert_trap (invoke "check_t0" (i32.const 17)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 18)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 19)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 20)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 21)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 22)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 23)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 24)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 25)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 26)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 27)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 28)) "uninitialized element")
(assert_trap (invoke "check_t0" (i32.const 29)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 0)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 1)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 2)) "uninitialized element")
(assert_return (invoke "check_t1" (i32.const 3)) (i32.const 1))
(assert_return (invoke "check_t1" (i32.const 4)) (i32.const 3))
(assert_return (invoke "check_t1" (i32.const 5)) (i32.const 1))
(assert_return (invoke "check_t1" (i32.const 6)) (i32.const 4))
(assert_trap (invoke "check_t1" (i32.const 7)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 8)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 9)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 10)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 11)) "uninitialized element")
(assert_return (invoke "check_t1" (i32.const 12)) (i32.const 3))
(assert_return (invoke "check_t1" (i32.const 13)) (i32.const 1))
(assert_return (invoke "check_t1" (i32.const 14)) (i32.const 4))
(assert_return (invoke "check_t1" (i32.const 15)) (i32.const 1))
(assert_trap (invoke "check_t1" (i32.const 16)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 17)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 18)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 19)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 20)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 21)) "uninitialized element")
(assert_return (invoke "check_t1" (i32.const 22)) (i32.const 7))
(assert_return (invoke "check_t1" (i32.const 23)) (i32.const 5))
(assert_return (invoke "check_t1" (i32.const 24)) (i32.const 2))
(assert_return (invoke "check_t1" (i32.const 25)) (i32.const 3))
(assert_return (invoke "check_t1" (i32.const 26)) (i32.const 6))
(assert_trap (invoke "check_t1" (i32.const 27)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 28)) "uninitialized element")
(assert_trap (invoke "check_t1" (i32.const 29)) "uninitialized element")

(module
  (table $t0 30 30 funcref)
  (table $t1 30 30 funcref)
  (elem (table $t0) (i32.const 2) func 3 1 4 1)
  (elem funcref
    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))
  (elem (table $t0) (i32.const 12) func 7 5 2 3 6)
  (elem funcref
    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))
  (func (result i32) (i32.const 0))
  (func (result i32) (i32.const 1))
  (func (result i32) (i32.const 2))
  (func (result i32) (i32.const 3))
  (func (result i32) (i32.const 4))
  (func (result i32) (i32.const 5))
  (func (result i32) (i32.const 6))
  (func (result i32) (i32.const 7))
  (func (result i32) (i32.const 8))
  (func (result i32) (i32.const 9))
  (func (export "test")
    (table.copy $t0 $t0 (i32.const 28) (i32.const 1) (i32.const 3))
    ))

(assert_trap (invoke "test") "out of bounds table access")

(module
  (table $t0 30 30 funcref)
  (table $t1 30 30 funcref)
  (elem (table $t0) (i32.const 2) func 3 1 4 1)
  (elem funcref
    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))
  (elem (table $t0) (i32.const 12) func 7 5 2 3 6)
  (elem funcref
    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))
  (func (result i32) (i32.const 0))
  (func (result i32) (i32.const 1))
  (func (result i32) (i32.const 2))
  (func (result i32) (i32.const 3))
  (func (result i32) (i32.const 4))
  (func (result i32) (i32.const 5))
  (func (result i32) (i32.const 6))
  (func (result i32) (i32.const 7))
  (func (result i32) (i32.const 8))
  (func (result i32) (i32.const 9))
  (func (export "test")
    (table.copy $t0 $t0 (i32.const 0xFFFFFFFE) (i32.const 1) (i32.const 2))
    ))

(assert_trap (invoke "test") "out of bounds table access")

(module
  (table $t0 30 30 funcref)
  (table $t1 30 30 funcref)
  (elem (table $t0) (i32.const 2) func 3 1 4 1)
  (elem funcref
    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))
  (elem (table $t0) (i32.const 12) func 7 5 2 3 6)
  (elem funcref
    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))
  (func (result i32) (i32.const 0))
  (func (result i32) (i32.const 1))
  (func (result i32) (i32.const 2))
  (func (result i32) (i32.const 3))
  (func (result i32) (i32.const 4))
  (func (result i32) (i32.const 5))
  (func (result i32) (i32.const 6))
  (func (result i32) (i32.const 7))
  (func (result i32) (i32.const 8))
  (func (result i32) (i32.const 9))
  (func (export "test")
    (table.copy $t0 $t0 (i32.const 15) (i32.const 25) (i32.const 6))
    ))

(assert_trap (invoke "test") "out of bounds table access")

(module
  (table $t0 30 30 funcref)
  (table $t1 30 30 funcref)
  (elem (table $t0) (i32.const 2) func 3 1 4 1)
  (elem funcref
    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))
  (elem (table $t0) (i32.const 12) func 7 5 2 3 6)
  (elem funcref
    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))
  (func (result i32) (i32.const 0))
  (func (result i32) (i32.const 1))
  (func (result i32) (i32.const 2))
  (func (result i32) (i32.const 3))
  (func (result i32) (i32.const 4))
  (func (result i32) (i32.const 5))
  (func (result i32) (i32.const 6))
  (func (result i32) (i32.const 7))
  (func (result i32) (i32.const 8))
  (func (result i32) (i32.const 9))
  (func (export "test")
    (table.copy $t0 $t0 (i32.const 15) (i32.const 0xFFFFFFFE) (i32.const 2))
    ))

(assert_trap (invoke "test") "out of bounds table access")

(module
  (table $t0 30 30 funcref)
  (table $t1 30 30 funcref)
  (elem (table $t0) (i32.const 2) func 3 1 4 1)
  (elem funcref
    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))
  (elem (table $t0) (i32.const 12) func 7 5 2 3 6)
  (elem funcref
    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))
  (func (result i32) (i32.const 0))
  (func (result i32) (i32.const 1))
  (func (result i32) (i32.const 2))
  (func (result i32) (i32.const 3))
  (func (result i32) (i32.const 4))
  (func (result i32) (i32.const 5))
  (func (result i32) (i32.const 6))
  (func (result i32) (i32.const 7))
  (func (result i32) (i32.const 8))
  (func (result i32) (i32.const 9))
  (func (export "test")
    (table.copy $t0 $t0 (i32.const 15) (i32.const 25) (i32.const 0))
    ))

(invoke "test")

(module
  (table $t0 30 30 funcref)
  (table $t1 30 30 funcref)
  (elem (table $t0) (i32.const 2) func 3 1 4 1)
  (elem funcref
    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))
  (elem (table $t0) (i32.const 12) func 7 5 2 3 6)
  (elem funcref
    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))
  (func (result i32) (i32.const 0))
  (func (result i32) (i32.const 1))
  (func (result i32) (i32.const 2))
  (func (result i32) (i32.const 3))
  (func (result i32) (i32.const 4))
  (func (result i32) (i32.const 5))
  (func (result i32) (i32.const 6))
  (func (result i32) (i32.const 7))
  (func (result i32) (i32.const 8))
  (func (result i32) (i32.const 9))
  (func (export "test")
    (table.copy $t0 $t0 (i32.const 30) (i32.const 15) (i32.const 0))
    ))

(invoke "test")

(module
  (table $t0 30 30 funcref)
  (table $t1 30 30 funcref)
  (elem (table $t0) (i32.const 2) func 3 1 4 1)
  (elem funcref
    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))
  (elem (table $t0) (i32.const 12) func 7 5 2 3 6)
  (elem funcref
    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))
  (func (result i32) (i32.const 0))
  (func (result i32) (i32.const 1))
  (func (result i32) (i32.const 2))
  (func (result i32) (i32.const 3))
  (func (result i32) (i32.const 4))
  (func (result i32) (i32.const 5))
  (func (result i32) (i32.const 6))
  (func (result i32) (i32.const 7))
  (func (result i32) (i32.const 8))
  (func (result i32) (i32.const 9))
  (func (export "test")
    (table.copy $t0 $t0 (i32.const 31) (i32.const 15) (i32.const 0))
    ))

(assert_trap (invoke "test") "out of bounds table access")

(module
  (table $t0 30 30 funcref)
  (table $t1 30 30 funcref)
  (elem (table $t0) (i32.const 2) func 3 1 4 1)
  (elem funcref
    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))
  (elem (table $t0) (i32.const 12) func 7 5 2 3 6)
  (elem funcref
    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))
  (func (result i32) (i32.const 0))
  (func (result i32) (i32.const 1))
  (func (result i32) (i32.const 2))
  (func (result i32) (i32.const 3))
  (func (result i32) (i32.const 4))
  (func (result i32) (i32.const 5))
  (func (result i32) (i32.const 6))
  (func (result i32) (i32.const 7))
  (func (result i32) (i32.const 8))
  (func (result i32) (i32.const 9))
  (func (export "test")
    (table.copy $t0 $t0 (i32.const 15) (i32.const 30) (i32.const 0))
    ))

(invoke "test")

(module
  (table $t0 30 30 funcref)
  (table $t1 30 30 funcref)
  (elem (table $t0) (i32.const 2) func 3 1 4 1)
  (elem funcref
    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))
  (elem (table $t0) (i32.const 12) func 7 5 2 3 6)
  (elem funcref
    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))
  (func (result i32) (i32.const 0))
  (func (result i32) (i32.const 1))
  (func (result i32) (i32.const 2))
  (func (result i32) (i32.const 3))
  (func (result i32) (i32.const 4))
  (func (result i32) (i32.const 5))
  (func (result i32) (i32.const 6))
  (func (result i32) (i32.const 7))
  (func (result i32) (i32.const 8))
  (func (result i32) (i32.const 9))
  (func (export "test")
    (table.copy $t0 $t0 (i32.const 15) (i32.const 31) (i32.const 0))
    ))

(assert_trap (invoke "test") "out of bounds table access")

(module
  (table $t0 30 30 funcref)
  (table $t1 30 30 funcref)
  (elem (table $t0) (i32.const 2) func 3 1 4 1)
  (elem funcref
    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))
  (elem (table $t0) (i32.const 12) func 7 5 2 3 6)
  (elem funcref
    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))
  (func (result i32) (i32.const 0))
  (func (result i32) (i32.const 1))
  (func (result i32) (i32.const 2))
  (func (result i32) (i32.const 3))
  (func (result i32) (i32.const 4))
  (func (result i32) (i32.const 5))
  (func (result i32) (i32.const 6))
  (func (result i32) (i32.const 7))
  (func (result i32) (i32.const 8))
  (func (result i32) (i32.const 9))
  (func (export "test")
    (table.copy $t0 $t0 (i32.const 30) (i32.const 30) (i32.const 0))
    ))

(invoke "test")

(module
  (table $t0 30 30 funcref)
  (table $t1 30 30 funcref)
  (elem (table $t0) (i32.const 2) func 3 1 4 1)
  (elem funcref
    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))
  (elem (table $t0) (i32.const 12) func 7 5 2 3 6)
  (elem funcref
    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))
  (func (result i32) (i32.const 0))
  (func (result i32) (i32.const 1))
  (func (result i32) (i32.const 2))
  (func (result i32) (i32.const 3))
  (func (result i32) (i32.const 4))
  (func (result i32) (i32.const 5))
  (func (result i32) (i32.const 6))
  (func (result i32) (i32.const 7))
  (func (result i32) (i32.const 8))
  (func (result i32) (i32.const 9))
  (func (export "test")
    (table.copy $t0 $t0 (i32.const 31) (i32.const 31) (i32.const 0))
    ))

(assert_trap (invoke "test") "out of bounds table access")

(module
  (table $t0 30 30 funcref)
  (table $t1 30 30 funcref)
  (elem (table $t0) (i32.const 2) func 3 1 4 1)
  (elem funcref
    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))
  (elem (table $t0) (i32.const 12) func 7 5 2 3 6)
  (elem funcref
    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))
  (func (result i32) (i32.const 0))
  (func (result i32) (i32.const 1))
  (func (result i32) (i32.const 2))
  (func (result i32) (i32.const 3))
  (func (result i32) (i32.const 4))
  (func (result i32) (i32.const 5))
  (func (result i32) (i32.const 6))
  (func (result i32) (i32.const 7))
  (func (result i32) (i32.const 8))
  (func (result i32) (i32.const 9))
  (func (export "test")
    (table.copy $t1 $t0 (i32.const 28) (i32.const 1) (i32.const 3))
    ))

(assert_trap (invoke "test") "out of bounds table access")

(module
  (table $t0 30 30 funcref)
  (table $t1 30 30 funcref)
  (elem (table $t0) (i32.const 2) func 3 1 4 1)
  (elem funcref
    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))
  (elem (table $t0) (i32.const 12) func 7 5 2 3 6)
  (elem funcref
    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))
  (func (result i32) (i32.const 0))
  (func (result i32) (i32.const 1))
  (func (result i32) (i32.const 2))
  (func (result i32) (i32.const 3))
  (func (result i32) (i32.const 4))
  (func (result i32) (i32.const 5))
  (func (result i32) (i32.const 6))
  (func (result i32) (i32.const 7))
  (func (result i32) (i32.const 8))
  (func (result i32) (i32.const 9))
  (func (export "test")
    (table.copy $t1 $t0 (i32.const 0xFFFFFFFE) (i32.const 1) (i32.const 2))
    ))

(assert_trap (invoke "test") "out of bounds table access")

(module
  (table $t0 30 30 funcref)
  (table $t1 30 30 funcref)
  (elem (table $t0) (i32.const 2) func 3 1 4 1)
  (elem funcref
    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))
  (elem (table $t0) (i32.const 12) func 7 5 2 3 6)
  (elem funcref
    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))
  (func (result i32) (i32.const 0))
  (func (result i32) (i32.const 1))
  (func (result i32) (i32.const 2))
  (func (result i32) (i32.const 3))
  (func (result i32) (i32.const 4))
  (func (result i32) (i32.const 5))
  (func (result i32) (i32.const 6))
  (func (result i32) (i32.const 7))
  (func (result i32) (i32.const 8))
  (func (result i32) (i32.const 9))
  (func (export "test")
    (table.copy $t1 $t0 (i32.const 15) (i32.const 25) (i32.const 6))
    ))

(assert_trap (invoke "test") "out of bounds table access")

(module
  (table $t0 30 30 funcref)
  (table $t1 30 30 funcref)
  (elem (table $t0) (i32.const 2) func 3 1 4 1)
  (elem funcref
    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))
  (elem (table $t0) (i32.const 12) func 7 5 2 3 6)
  (elem funcref
    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))
  (func (result i32) (i32.const 0))
  (func (result i32) (i32.const 1))
  (func (result i32) (i32.const 2))
  (func (result i32) (i32.const 3))
  (func (result i32) (i32.const 4))
  (func (result i32) (i32.const 5))
  (func (result i32) (i32.const 6))
  (func (result i32) (i32.const 7))
  (func (result i32) (i32.const 8))
  (func (result i32) (i32.const 9))
  (func (export "test")
    (table.copy $t1 $t0 (i32.const 15) (i32.const 0xFFFFFFFE) (i32.const 2))
    ))

(assert_trap (invoke "test") "out of bounds table access")

(module
  (table $t0 30 30 funcref)
  (table $t1 30 30 funcref)
  (elem (table $t0) (i32.const 2) func 3 1 4 1)
  (elem funcref
    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))
  (elem (table $t0) (i32.const 12) func 7 5 2 3 6)
  (elem funcref
    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))
  (func (result i32) (i32.const 0))
  (func (result i32) (i32.const 1))
  (func (result i32) (i32.const 2))
  (func (result i32) (i32.const 3))
  (func (result i32) (i32.const 4))
  (func (result i32) (i32.const 5))
  (func (result i32) (i32.const 6))
  (func (result i32) (i32.const 7))
  (func (result i32) (i32.const 8))
  (func (result i32) (i32.const 9))
  (func (export "test")
    (table.copy $t1 $t0 (i32.const 15) (i32.const 25) (i32.const 0))
    ))

(invoke "test")

(module
  (table $t0 30 30 funcref)
  (table $t1 30 30 funcref)
  (elem (table $t0) (i32.const 2) func 3 1 4 1)
  (elem funcref
    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))
  (elem (table $t0) (i32.const 12) func 7 5 2 3 6)
  (elem funcref
    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))
  (func (result i32) (i32.const 0))
  (func (result i32) (i32.const 1))
  (func (result i32) (i32.const 2))
  (func (result i32) (i32.const 3))
  (func (result i32) (i32.const 4))
  (func (result i32) (i32.const 5))
  (func (result i32) (i32.const 6))
  (func (result i32) (i32.const 7))
  (func (result i32) (i32.const 8))
  (func (result i32) (i32.const 9))
  (func (export "test")
    (table.copy $t1 $t0 (i32.const 30) (i32.const 15) (i32.const 0))
    ))

(invoke "test")

(module
  (table $t0 30 30 funcref)
  (table $t1 30 30 funcref)
  (elem (table $t0) (i32.const 2) func 3 1 4 1)
  (elem funcref
    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))
  (elem (table $t0) (i32.const 12) func 7 5 2 3 6)
  (elem funcref
    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))
  (func (result i32) (i32.const 0))
  (func (result i32) (i32.const 1))
  (func (result i32) (i32.const 2))
  (func (result i32) (i32.const 3))
  (func (result i32) (i32.const 4))
  (func (result i32) (i32.const 5))
  (func (result i32) (i32.const 6))
  (func (result i32) (i32.const 7))
  (func (result i32) (i32.const 8))
  (func (result i32) (i32.const 9))
  (func (export "test")
    (table.copy $t1 $t0 (i32.const 31) (i32.const 15) (i32.const 0))
    ))

(assert_trap (invoke "test") "out of bounds table access")

(module
  (table $t0 30 30 funcref)
  (table $t1 30 30 funcref)
  (elem (table $t0) (i32.const 2) func 3 1 4 1)
  (elem funcref
    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))
  (elem (table $t0) (i32.const 12) func 7 5 2 3 6)
  (elem funcref
    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))
  (func (result i32) (i32.const 0))
  (func (result i32) (i32.const 1))
  (func (result i32) (i32.const 2))
  (func (result i32) (i32.const 3))
  (func (result i32) (i32.const 4))
  (func (result i32) (i32.const 5))
  (func (result i32) (i32.const 6))
  (func (result i32) (i32.const 7))
  (func (result i32) (i32.const 8))
  (func (result i32) (i32.const 9))
  (func (export "test")
    (table.copy $t1 $t0 (i32.const 15) (i32.const 30) (i32.const 0))
    ))

(invoke "test")

(module
  (table $t0 30 30 funcref)
  (table $t1 30 30 funcref)
  (elem (table $t0) (i32.const 2) func 3 1 4 1)
  (elem funcref
    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))
  (elem (table $t0) (i32.const 12) func 7 5 2 3 6)
  (elem funcref
    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))
  (func (result i32) (i32.const 0))
  (func (result i32) (i32.const 1))
  (func (result i32) (i32.const 2))
  (func (result i32) (i32.const 3))
  (func (result i32) (i32.const 4))
  (func (result i32) (i32.const 5))
  (func (result i32) (i32.const 6))
  (func (result i32) (i32.const 7))
  (func (result i32) (i32.const 8))
  (func (result i32) (i32.const 9))
  (func (export "test")
    (table.copy $t1 $t0 (i32.const 15) (i32.const 31) (i32.const 0))
    ))

(assert_trap (invoke "test") "out of bounds table access")

(module
  (table $t0 30 30 funcref)
  (table $t1 30 30 funcref)
  (elem (table $t0) (i32.const 2) func 3 1 4 1)
  (elem funcref
    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))
  (elem (table $t0) (i32.const 12) func 7 5 2 3 6)
  (elem funcref
    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))
  (func (result i32) (i32.const 0))
  (func (result i32) (i32.const 1))
  (func (result i32) (i32.const 2))
  (func (result i32) (i32.const 3))
  (func (result i32) (i32.const 4))
  (func (result i32) (i32.const 5))
  (func (result i32) (i32.const 6))
  (func (result i32) (i32.const 7))
  (func (result i32) (i32.const 8))
  (func (result i32) (i32.const 9))
  (func (export "test")
    (table.copy $t1 $t0 (i32.const 30) (i32.const 30) (i32.const 0))
    ))

(invoke "test")

(module
  (table $t0 30 30 funcref)
  (table $t1 30 30 funcref)
  (elem (table $t0) (i32.const 2) func 3 1 4 1)
  (elem funcref
    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))
  (elem (table $t0) (i32.const 12) func 7 5 2 3 6)
  (elem funcref
    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))
  (func (result i32) (i32.const 0))
  (func (result i32) (i32.const 1))
  (func (result i32) (i32.const 2))
  (func (result i32) (i32.const 3))
  (func (result i32) (i32.const 4))
  (func (result i32) (i32.const 5))
  (func (result i32) (i32.const 6))
  (func (result i32) (i32.const 7))
  (func (result i32) (i32.const 8))
  (func (result i32) (i32.const 9))
  (func (export "test")
    (table.copy $t1 $t0 (i32.const 31) (i32.const 31) (i32.const 0))
    ))

(assert_trap (invoke "test") "out of bounds table access")

(module
  (type (func (result i32)))
  (table 32 64 funcref)
  (elem (i32.const 0)
         $f0 $f1 $f2 $f3 $f4 $f5 $f6 $f7)
  (func $f0 (export "f0") (result i32) (i32.const 0))
  (func $f1 (export "f1") (result i32) (i32.const 1))
  (func $f2 (export "f2") (result i32) (i32.const 2))
  (func $f3 (export "f3") (result i32) (i32.const 3))
  (func $f4 (export "f4") (result i32) (i32.const 4))
  (func $f5 (export "f5") (result i32) (i32.const 5))
  (func $f6 (export "f6") (result i32) (i32.const 6))
  (func $f7 (export "f7") (result i32) (i32.const 7))
  (func $f8 (export "f8") (result i32) (i32.const 8))
  (func $f9 (export "f9") (result i32) (i32.const 9))
  (func $f10 (export "f10") (result i32) (i32.const 10))
  (func $f11 (export "f11") (result i32) (i32.const 11))
  (func $f12 (export "f12") (result i32) (i32.const 12))
  (func $f13 (export "f13") (result i32) (i32.const 13))
  (func $f14 (export "f14") (result i32) (i32.const 14))
  (func $f15 (export "f15") (result i32) (i32.const 15))
  (func (export "test") (param $n i32) (result i32)
    (call_indirect (type 0) (local.get $n)))
  (func (export "run") (param $targetOffs i32) (param $srcOffs i32) (param $len i32)
    (table.copy (local.get $targetOffs) (local.get $srcOffs) (local.get $len))))

(assert_trap (invoke "run" (i32.const 24) (i32.const 0) (i32.const 16))
             "out of bounds table access")
(assert_return (invoke "test" (i32.const 0)) (i32.const 0))
(assert_return (invoke "test" (i32.const 1)) (i32.const 1))
(assert_return (invoke "test" (i32.const 2)) (i32.const 2))
(assert_return (invoke "test" (i32.const 3)) (i32.const 3))
(assert_return (invoke "test" (i32.const 4)) (i32.const 4))
(assert_return (invoke "test" (i32.const 5)) (i32.const 5))
(assert_return (invoke "test" (i32.const 6)) (i32.const 6))
(assert_return (invoke "test" (i32.const 7)) (i32.const 7))
(assert_trap (invoke "test" (i32.const 8)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 9)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 10)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 11)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 12)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 13)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 14)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 15)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 16)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 17)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 18)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 19)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 20)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 21)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 22)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 23)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 24)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 25)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 26)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 27)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 28)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 29)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 30)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 31)) "uninitialized element")

(module
  (type (func (result i32)))
  (table 32 64 funcref)
  (elem (i32.const 0)
         $f0 $f1 $f2 $f3 $f4 $f5 $f6 $f7 $f8)
  (func $f0 (export "f0") (result i32) (i32.const 0))
  (func $f1 (export "f1") (result i32) (i32.const 1))
  (func $f2 (export "f2") (result i32) (i32.const 2))
  (func $f3 (export "f3") (result i32) (i32.const 3))
  (func $f4 (export "f4") (result i32) (i32.const 4))
  (func $f5 (export "f5") (result i32) (i32.const 5))
  (func $f6 (export "f6") (result i32) (i32.const 6))
  (func $f7 (export "f7") (result i32) (i32.const 7))
  (func $f8 (export "f8") (result i32) (i32.const 8))
  (func $f9 (export "f9") (result i32) (i32.const 9))
  (func $f10 (export "f10") (result i32) (i32.const 10))
  (func $f11 (export "f11") (result i32) (i32.const 11))
  (func $f12 (export "f12") (result i32) (i32.const 12))
  (func $f13 (export "f13") (result i32) (i32.const 13))
  (func $f14 (export "f14") (result i32) (i32.const 14))
  (func $f15 (export "f15") (result i32) (i32.const 15))
  (func (export "test") (param $n i32) (result i32)
    (call_indirect (type 0) (local.get $n)))
  (func (export "run") (param $targetOffs i32) (param $srcOffs i32) (param $len i32)
    (table.copy (local.get $targetOffs) (local.get $srcOffs) (local.get $len))))

(assert_trap (invoke "run" (i32.const 23) (i32.const 0) (i32.const 15))
             "out of bounds table access")
(assert_return (invoke "test" (i32.const 0)) (i32.const 0))
(assert_return (invoke "test" (i32.const 1)) (i32.const 1))
(assert_return (invoke "test" (i32.const 2)) (i32.const 2))
(assert_return (invoke "test" (i32.const 3)) (i32.const 3))
(assert_return (invoke "test" (i32.const 4)) (i32.const 4))
(assert_return (invoke "test" (i32.const 5)) (i32.const 5))
(assert_return (invoke "test" (i32.const 6)) (i32.const 6))
(assert_return (invoke "test" (i32.const 7)) (i32.const 7))
(assert_return (invoke "test" (i32.const 8)) (i32.const 8))
(assert_trap (invoke "test" (i32.const 9)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 10)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 11)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 12)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 13)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 14)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 15)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 16)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 17)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 18)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 19)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 20)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 21)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 22)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 23)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 24)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 25)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 26)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 27)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 28)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 29)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 30)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 31)) "uninitialized element")

(module
  (type (func (result i32)))
  (table 32 64 funcref)
  (elem (i32.const 24)
         $f0 $f1 $f2 $f3 $f4 $f5 $f6 $f7)
  (func $f0 (export "f0") (result i32) (i32.const 0))
  (func $f1 (export "f1") (result i32) (i32.const 1))
  (func $f2 (export "f2") (result i32) (i32.const 2))
  (func $f3 (export "f3") (result i32) (i32.const 3))
  (func $f4 (export "f4") (result i32) (i32.const 4))
  (func $f5 (export "f5") (result i32) (i32.const 5))
  (func $f6 (export "f6") (result i32) (i32.const 6))
  (func $f7 (export "f7") (result i32) (i32.const 7))
  (func $f8 (export "f8") (result i32) (i32.const 8))
  (func $f9 (export "f9") (result i32) (i32.const 9))
  (func $f10 (export "f10") (result i32) (i32.const 10))
  (func $f11 (export "f11") (result i32) (i32.const 11))
  (func $f12 (export "f12") (result i32) (i32.const 12))
  (func $f13 (export "f13") (result i32) (i32.const 13))
  (func $f14 (export "f14") (result i32) (i32.const 14))
  (func $f15 (export "f15") (result i32) (i32.const 15))
  (func (export "test") (param $n i32) (result i32)
    (call_indirect (type 0) (local.get $n)))
  (func (export "run") (param $targetOffs i32) (param $srcOffs i32) (param $len i32)
    (table.copy (local.get $targetOffs) (local.get $srcOffs) (local.get $len))))

(assert_trap (invoke "run" (i32.const 0) (i32.const 24) (i32.const 16))
             "out of bounds table access")
(assert_trap (invoke "test" (i32.const 0)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 1)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 2)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 3)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 4)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 5)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 6)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 7)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 8)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 9)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 10)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 11)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 12)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 13)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 14)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 15)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 16)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 17)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 18)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 19)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 20)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 21)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 22)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 23)) "uninitialized element")
(assert_return (invoke "test" (i32.const 24)) (i32.const 0))
(assert_return (invoke "test" (i32.const 25)) (i32.const 1))
(assert_return (invoke "test" (i32.const 26)) (i32.const 2))
(assert_return (invoke "test" (i32.const 27)) (i32.const 3))
(assert_return (invoke "test" (i32.const 28)) (i32.const 4))
(assert_return (invoke "test" (i32.const 29)) (i32.const 5))
(assert_return (invoke "test" (i32.const 30)) (i32.const 6))
(assert_return (invoke "test" (i32.const 31)) (i32.const 7))

(module
  (type (func (result i32)))
  (table 32 64 funcref)
  (elem (i32.const 23)
         $f0 $f1 $f2 $f3 $f4 $f5 $f6 $f7 $f8)
  (func $f0 (export "f0") (result i32) (i32.const 0))
  (func $f1 (export "f1") (result i32) (i32.const 1))
  (func $f2 (export "f2") (result i32) (i32.const 2))
  (func $f3 (export "f3") (result i32) (i32.const 3))
  (func $f4 (export "f4") (result i32) (i32.const 4))
  (func $f5 (export "f5") (result i32) (i32.const 5))
  (func $f6 (export "f6") (result i32) (i32.const 6))
  (func $f7 (export "f7") (result i32) (i32.const 7))
  (func $f8 (export "f8") (result i32) (i32.const 8))
  (func $f9 (export "f9") (result i32) (i32.const 9))
  (func $f10 (export "f10") (result i32) (i32.const 10))
  (func $f11 (export "f11") (result i32) (i32.const 11))
  (func $f12 (export "f12") (result i32) (i32.const 12))
  (func $f13 (export "f13") (result i32) (i32.const 13))
  (func $f14 (export "f14") (result i32) (i32.const 14))
  (func $f15 (export "f15") (result i32) (i32.const 15))
  (func (export "test") (param $n i32) (result i32)
    (call_indirect (type 0) (local.get $n)))
  (func (export "run") (param $targetOffs i32) (param $srcOffs i32) (param $len i32)
    (table.copy (local.get $targetOffs) (local.get $srcOffs) (local.get $len))))

(assert_trap (invoke "run" (i32.const 0) (i32.const 23) (i32.const 15))
             "out of bounds table access")
(assert_trap (invoke "test" (i32.const 0)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 1)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 2)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 3)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 4)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 5)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 6)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 7)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 8)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 9)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 10)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 11)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 12)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 13)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 14)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 15)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 16)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 17)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 18)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 19)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 20)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 21)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 22)) "uninitialized element")
(assert_return (invoke "test" (i32.const 23)) (i32.const 0))
(assert_return (invoke "test" (i32.const 24)) (i32.const 1))
(assert_return (invoke "test" (i32.const 25)) (i32.const 2))
(assert_return (invoke "test" (i32.const 26)) (i32.const 3))
(assert_return (invoke "test" (i32.const 27)) (i32.const 4))
(assert_return (invoke "test" (i32.const 28)) (i32.const 5))
(assert_return (invoke "test" (i32.const 29)) (i32.const 6))
(assert_return (invoke "test" (i32.const 30)) (i32.const 7))
(assert_return (invoke "test" (i32.const 31)) (i32.const 8))

(module
  (type (func (result i32)))
  (table 32 64 funcref)
  (elem (i32.const 11)
         $f0 $f1 $f2 $f3 $f4 $f5 $f6 $f7)
  (func $f0 (export "f0") (result i32) (i32.const 0))
  (func $f1 (export "f1") (result i32) (i32.const 1))
  (func $f2 (export "f2") (result i32) (i32.const 2))
  (func $f3 (export "f3") (result i32) (i32.const 3))
  (func $f4 (export "f4") (result i32) (i32.const 4))
  (func $f5 (export "f5") (result i32) (i32.const 5))
  (func $f6 (export "f6") (result i32) (i32.const 6))
  (func $f7 (export "f7") (result i32) (i32.const 7))
  (func $f8 (export "f8") (result i32) (i32.const 8))
  (func $f9 (export "f9") (result i32) (i32.const 9))
  (func $f10 (export "f10") (result i32) (i32.const 10))
  (func $f11 (export "f11") (result i32) (i32.const 11))
  (func $f12 (export "f12") (result i32) (i32.const 12))
  (func $f13 (export "f13") (result i32) (i32.const 13))
  (func $f14 (export "f14") (result i32) (i32.const 14))
  (func $f15 (export "f15") (result i32) (i32.const 15))
  (func (export "test") (param $n i32) (result i32)
    (call_indirect (type 0) (local.get $n)))
  (func (export "run") (param $targetOffs i32) (param $srcOffs i32) (param $len i32)
    (table.copy (local.get $targetOffs) (local.get $srcOffs) (local.get $len))))

(assert_trap (invoke "run" (i32.const 24) (i32.const 11) (i32.const 16))
             "out of bounds table access")
(assert_trap (invoke "test" (i32.const 0)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 1)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 2)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 3)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 4)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 5)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 6)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 7)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 8)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 9)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 10)) "uninitialized element")
(assert_return (invoke "test" (i32.const 11)) (i32.const 0))
(assert_return (invoke "test" (i32.const 12)) (i32.const 1))
(assert_return (invoke "test" (i32.const 13)) (i32.const 2))
(assert_return (invoke "test" (i32.const 14)) (i32.const 3))
(assert_return (invoke "test" (i32.const 15)) (i32.const 4))
(assert_return (invoke "test" (i32.const 16)) (i32.const 5))
(assert_return (invoke "test" (i32.const 17)) (i32.const 6))
(assert_return (invoke "test" (i32.const 18)) (i32.const 7))
(assert_trap (invoke "test" (i32.const 19)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 20)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 21)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 22)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 23)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 24)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 25)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 26)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 27)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 28)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 29)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 30)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 31)) "uninitialized element")

(module
  (type (func (result i32)))
  (table 32 64 funcref)
  (elem (i32.const 24)
         $f0 $f1 $f2 $f3 $f4 $f5 $f6 $f7)
  (func $f0 (export "f0") (result i32) (i32.const 0))
  (func $f1 (export "f1") (result i32) (i32.const 1))
  (func $f2 (export "f2") (result i32) (i32.const 2))
  (func $f3 (export "f3") (result i32) (i32.const 3))
  (func $f4 (export "f4") (result i32) (i32.const 4))
  (func $f5 (export "f5") (result i32) (i32.const 5))
  (func $f6 (export "f6") (result i32) (i32.const 6))
  (func $f7 (export "f7") (result i32) (i32.const 7))
  (func $f8 (export "f8") (result i32) (i32.const 8))
  (func $f9 (export "f9") (result i32) (i32.const 9))
  (func $f10 (export "f10") (result i32) (i32.const 10))
  (func $f11 (export "f11") (result i32) (i32.const 11))
  (func $f12 (export "f12") (result i32) (i32.const 12))
  (func $f13 (export "f13") (result i32) (i32.const 13))
  (func $f14 (export "f14") (result i32) (i32.const 14))
  (func $f15 (export "f15") (result i32) (i32.const 15))
  (func (export "test") (param $n i32) (result i32)
    (call_indirect (type 0) (local.get $n)))
  (func (export "run") (param $targetOffs i32) (param $srcOffs i32) (param $len i32)
    (table.copy (local.get $targetOffs) (local.get $srcOffs) (local.get $len))))

(assert_trap (invoke "run" (i32.const 11) (i32.const 24) (i32.const 16))
             "out of bounds table access")
(assert_trap (invoke "test" (i32.const 0)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 1)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 2)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 3)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 4)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 5)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 6)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 7)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 8)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 9)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 10)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 11)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 12)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 13)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 14)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 15)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 16)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 17)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 18)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 19)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 20)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 21)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 22)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 23)) "uninitialized element")
(assert_return (invoke "test" (i32.const 24)) (i32.const 0))
(assert_return (invoke "test" (i32.const 25)) (i32.const 1))
(assert_return (invoke "test" (i32.const 26)) (i32.const 2))
(assert_return (invoke "test" (i32.const 27)) (i32.const 3))
(assert_return (invoke "test" (i32.const 28)) (i32.const 4))
(assert_return (invoke "test" (i32.const 29)) (i32.const 5))
(assert_return (invoke "test" (i32.const 30)) (i32.const 6))
(assert_return (invoke "test" (i32.const 31)) (i32.const 7))

(module
  (type (func (result i32)))
  (table 32 64 funcref)
  (elem (i32.const 21)
         $f0 $f1 $f2 $f3 $f4 $f5 $f6 $f7)
  (func $f0 (export "f0") (result i32) (i32.const 0))
  (func $f1 (export "f1") (result i32) (i32.const 1))
  (func $f2 (export "f2") (result i32) (i32.const 2))
  (func $f3 (export "f3") (result i32) (i32.const 3))
  (func $f4 (export "f4") (result i32) (i32.const 4))
  (func $f5 (export "f5") (result i32) (i32.const 5))
  (func $f6 (export "f6") (result i32) (i32.const 6))
  (func $f7 (export "f7") (result i32) (i32.const 7))
  (func $f8 (export "f8") (result i32) (i32.const 8))
  (func $f9 (export "f9") (result i32) (i32.const 9))
  (func $f10 (export "f10") (result i32) (i32.const 10))
  (func $f11 (export "f11") (result i32) (i32.const 11))
  (func $f12 (export "f12") (result i32) (i32.const 12))
  (func $f13 (export "f13") (result i32) (i32.const 13))
  (func $f14 (export "f14") (result i32) (i32.const 14))
  (func $f15 (export "f15") (result i32) (i32.const 15))
  (func (export "test") (param $n i32) (result i32)
    (call_indirect (type 0) (local.get $n)))
  (func (export "run") (param $targetOffs i32) (param $srcOffs i32) (param $len i32)
    (table.copy (local.get $targetOffs) (local.get $srcOffs) (local.get $len))))

(assert_trap (invoke "run" (i32.const 24) (i32.const 21) (i32.const 16))
             "out of bounds table access")
(assert_trap (invoke "test" (i32.const 0)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 1)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 2)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 3)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 4)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 5)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 6)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 7)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 8)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 9)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 10)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 11)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 12)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 13)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 14)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 15)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 16)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 17)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 18)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 19)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 20)) "uninitialized element")
(assert_return (invoke "test" (i32.const 21)) (i32.const 0))
(assert_return (invoke "test" (i32.const 22)) (i32.const 1))
(assert_return (invoke "test" (i32.const 23)) (i32.const 2))
(assert_return (invoke "test" (i32.const 24)) (i32.const 3))
(assert_return (invoke "test" (i32.const 25)) (i32.const 4))
(assert_return (invoke "test" (i32.const 26)) (i32.const 5))
(assert_return (invoke "test" (i32.const 27)) (i32.const 6))
(assert_return (invoke "test" (i32.const 28)) (i32.const 7))
(assert_trap (invoke "test" (i32.const 29)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 30)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 31)) "uninitialized element")

(module
  (type (func (result i32)))
  (table 32 64 funcref)
  (elem (i32.const 24)
         $f0 $f1 $f2 $f3 $f4 $f5 $f6 $f7)
  (func $f0 (export "f0") (result i32) (i32.const 0))
  (func $f1 (export "f1") (result i32) (i32.const 1))
  (func $f2 (export "f2") (result i32) (i32.const 2))
  (func $f3 (export "f3") (result i32) (i32.const 3))
  (func $f4 (export "f4") (result i32) (i32.const 4))
  (func $f5 (export "f5") (result i32) (i32.const 5))
  (func $f6 (export "f6") (result i32) (i32.const 6))
  (func $f7 (export "f7") (result i32) (i32.const 7))
  (func $f8 (export "f8") (result i32) (i32.const 8))
  (func $f9 (export "f9") (result i32) (i32.const 9))
  (func $f10 (export "f10") (result i32) (i32.const 10))
  (func $f11 (export "f11") (result i32) (i32.const 11))
  (func $f12 (export "f12") (result i32) (i32.const 12))
  (func $f13 (export "f13") (result i32) (i32.const 13))
  (func $f14 (export "f14") (result i32) (i32.const 14))
  (func $f15 (export "f15") (result i32) (i32.const 15))
  (func (export "test") (param $n i32) (result i32)
    (call_indirect (type 0) (local.get $n)))
  (func (export "run") (param $targetOffs i32) (param $srcOffs i32) (param $len i32)
    (table.copy (local.get $targetOffs) (local.get $srcOffs) (local.get $len))))

(assert_trap (invoke "run" (i32.const 21) (i32.const 24) (i32.const 16))
             "out of bounds table access")
(assert_trap (invoke "test" (i32.const 0)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 1)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 2)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 3)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 4)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 5)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 6)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 7)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 8)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 9)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 10)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 11)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 12)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 13)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 14)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 15)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 16)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 17)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 18)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 19)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 20)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 21)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 22)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 23)) "uninitialized element")
(assert_return (invoke "test" (i32.const 24)) (i32.const 0))
(assert_return (invoke "test" (i32.const 25)) (i32.const 1))
(assert_return (invoke "test" (i32.const 26)) (i32.const 2))
(assert_return (invoke "test" (i32.const 27)) (i32.const 3))
(assert_return (invoke "test" (i32.const 28)) (i32.const 4))
(assert_return (invoke "test" (i32.const 29)) (i32.const 5))
(assert_return (invoke "test" (i32.const 30)) (i32.const 6))
(assert_return (invoke "test" (i32.const 31)) (i32.const 7))

(module
  (type (func (result i32)))
  (table 32 64 funcref)
  (elem (i32.const 21)
         $f0 $f1 $f2 $f3 $f4 $f5 $f6 $f7 $f8 $f9 $f10)
  (func $f0 (export "f0") (result i32) (i32.const 0))
  (func $f1 (export "f1") (result i32) (i32.const 1))
  (func $f2 (export "f2") (result i32) (i32.const 2))
  (func $f3 (export "f3") (result i32) (i32.const 3))
  (func $f4 (export "f4") (result i32) (i32.const 4))
  (func $f5 (export "f5") (result i32) (i32.const 5))
  (func $f6 (export "f6") (result i32) (i32.const 6))
  (func $f7 (export "f7") (result i32) (i32.const 7))
  (func $f8 (export "f8") (result i32) (i32.const 8))
  (func $f9 (export "f9") (result i32) (i32.const 9))
  (func $f10 (export "f10") (result i32) (i32.const 10))
  (func $f11 (export "f11") (result i32) (i32.const 11))
  (func $f12 (export "f12") (result i32) (i32.const 12))
  (func $f13 (export "f13") (result i32) (i32.const 13))
  (func $f14 (export "f14") (result i32) (i32.const 14))
  (func $f15 (export "f15") (result i32) (i32.const 15))
  (func (export "test") (param $n i32) (result i32)
    (call_indirect (type 0) (local.get $n)))
  (func (export "run") (param $targetOffs i32) (param $srcOffs i32) (param $len i32)
    (table.copy (local.get $targetOffs) (local.get $srcOffs) (local.get $len))))

(assert_trap (invoke "run" (i32.const 21) (i32.const 21) (i32.const 16))
             "out of bounds table access")
(assert_trap (invoke "test" (i32.const 0)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 1)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 2)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 3)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 4)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 5)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 6)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 7)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 8)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 9)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 10)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 11)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 12)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 13)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 14)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 15)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 16)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 17)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 18)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 19)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 20)) "uninitialized element")
(assert_return (invoke "test" (i32.const 21)) (i32.const 0))
(assert_return (invoke "test" (i32.const 22)) (i32.const 1))
(assert_return (invoke "test" (i32.const 23)) (i32.const 2))
(assert_return (invoke "test" (i32.const 24)) (i32.const 3))
(assert_return (invoke "test" (i32.const 25)) (i32.const 4))
(assert_return (invoke "test" (i32.const 26)) (i32.const 5))
(assert_return (invoke "test" (i32.const 27)) (i32.const 6))
(assert_return (invoke "test" (i32.const 28)) (i32.const 7))
(assert_return (invoke "test" (i32.const 29)) (i32.const 8))
(assert_return (invoke "test" (i32.const 30)) (i32.const 9))
(assert_return (invoke "test" (i32.const 31)) (i32.const 10))

(module
  (type (func (result i32)))
  (table 128 128 funcref)
  (elem (i32.const 112)
         $f0 $f1 $f2 $f3 $f4 $f5 $f6 $f7 $f8 $f9 $f10 $f11 $f12 $f13 $f14 $f15)
  (func $f0 (export "f0") (result i32) (i32.const 0))
  (func $f1 (export "f1") (result i32) (i32.const 1))
  (func $f2 (export "f2") (result i32) (i32.const 2))
  (func $f3 (export "f3") (result i32) (i32.const 3))
  (func $f4 (export "f4") (result i32) (i32.const 4))
  (func $f5 (export "f5") (result i32) (i32.const 5))
  (func $f6 (export "f6") (result i32) (i32.const 6))
  (func $f7 (export "f7") (result i32) (i32.const 7))
  (func $f8 (export "f8") (result i32) (i32.const 8))
  (func $f9 (export "f9") (result i32) (i32.const 9))
  (func $f10 (export "f10") (result i32) (i32.const 10))
  (func $f11 (export "f11") (result i32) (i32.const 11))
  (func $f12 (export "f12") (result i32) (i32.const 12))
  (func $f13 (export "f13") (result i32) (i32.const 13))
  (func $f14 (export "f14") (result i32) (i32.const 14))
  (func $f15 (export "f15") (result i32) (i32.const 15))
  (func (export "test") (param $n i32) (result i32)
    (call_indirect (type 0) (local.get $n)))
  (func (export "run") (param $targetOffs i32) (param $srcOffs i32) (param $len i32)
    (table.copy (local.get $targetOffs) (local.get $srcOffs) (local.get $len))))

(assert_trap (invoke "run" (i32.const 0) (i32.const 112) (i32.const 4294967264))
             "out of bounds table access")
(assert_trap (invoke "test" (i32.const 0)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 1)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 2)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 3)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 4)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 5)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 6)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 7)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 8)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 9)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 10)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 11)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 12)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 13)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 14)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 15)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 16)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 17)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 18)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 19)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 20)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 21)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 22)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 23)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 24)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 25)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 26)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 27)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 28)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 29)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 30)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 31)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 32)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 33)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 34)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 35)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 36)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 37)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 38)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 39)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 40)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 41)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 42)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 43)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 44)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 45)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 46)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 47)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 48)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 49)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 50)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 51)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 52)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 53)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 54)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 55)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 56)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 57)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 58)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 59)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 60)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 61)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 62)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 63)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 64)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 65)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 66)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 67)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 68)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 69)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 70)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 71)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 72)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 73)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 74)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 75)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 76)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 77)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 78)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 79)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 80)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 81)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 82)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 83)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 84)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 85)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 86)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 87)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 88)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 89)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 90)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 91)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 92)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 93)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 94)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 95)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 96)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 97)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 98)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 99)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 100)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 101)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 102)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 103)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 104)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 105)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 106)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 107)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 108)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 109)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 110)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 111)) "uninitialized element")
(assert_return (invoke "test" (i32.const 112)) (i32.const 0))
(assert_return (invoke "test" (i32.const 113)) (i32.const 1))
(assert_return (invoke "test" (i32.const 114)) (i32.const 2))
(assert_return (invoke "test" (i32.const 115)) (i32.const 3))
(assert_return (invoke "test" (i32.const 116)) (i32.const 4))
(assert_return (invoke "test" (i32.const 117)) (i32.const 5))
(assert_return (invoke "test" (i32.const 118)) (i32.const 6))
(assert_return (invoke "test" (i32.const 119)) (i32.const 7))
(assert_return (invoke "test" (i32.const 120)) (i32.const 8))
(assert_return (invoke "test" (i32.const 121)) (i32.const 9))
(assert_return (invoke "test" (i32.const 122)) (i32.const 10))
(assert_return (invoke "test" (i32.const 123)) (i32.const 11))
(assert_return (invoke "test" (i32.const 124)) (i32.const 12))
(assert_return (invoke "test" (i32.const 125)) (i32.const 13))
(assert_return (invoke "test" (i32.const 126)) (i32.const 14))
(assert_return (invoke "test" (i32.const 127)) (i32.const 15))

(module
  (type (func (result i32)))
  (table 128 128 funcref)
  (elem (i32.const 0)
         $f0 $f1 $f2 $f3 $f4 $f5 $f6 $f7 $f8 $f9 $f10 $f11 $f12 $f13 $f14 $f15)
  (func $f0 (export "f0") (result i32) (i32.const 0))
  (func $f1 (export "f1") (result i32) (i32.const 1))
  (func $f2 (export "f2") (result i32) (i32.const 2))
  (func $f3 (export "f3") (result i32) (i32.const 3))
  (func $f4 (export "f4") (result i32) (i32.const 4))
  (func $f5 (export "f5") (result i32) (i32.const 5))
  (func $f6 (export "f6") (result i32) (i32.const 6))
  (func $f7 (export "f7") (result i32) (i32.const 7))
  (func $f8 (export "f8") (result i32) (i32.const 8))
  (func $f9 (export "f9") (result i32) (i32.const 9))
  (func $f10 (export "f10") (result i32) (i32.const 10))
  (func $f11 (export "f11") (result i32) (i32.const 11))
  (func $f12 (export "f12") (result i32) (i32.const 12))
  (func $f13 (export "f13") (result i32) (i32.const 13))
  (func $f14 (export "f14") (result i32) (i32.const 14))
  (func $f15 (export "f15") (result i32) (i32.const 15))
  (func (export "test") (param $n i32) (result i32)
    (call_indirect (type 0) (local.get $n)))
  (func (export "run") (param $targetOffs i32) (param $srcOffs i32) (param $len i32)
    (table.copy (local.get $targetOffs) (local.get $srcOffs) (local.get $len))))

(assert_trap (invoke "run" (i32.const 112) (i32.const 0) (i32.const 4294967264))
             "out of bounds table access")
(assert_return (invoke "test" (i32.const 0)) (i32.const 0))
(assert_return (invoke "test" (i32.const 1)) (i32.const 1))
(assert_return (invoke "test" (i32.const 2)) (i32.const 2))
(assert_return (invoke "test" (i32.const 3)) (i32.const 3))
(assert_return (invoke "test" (i32.const 4)) (i32.const 4))
(assert_return (invoke "test" (i32.const 5)) (i32.const 5))
(assert_return (invoke "test" (i32.const 6)) (i32.const 6))
(assert_return (invoke "test" (i32.const 7)) (i32.const 7))
(assert_return (invoke "test" (i32.const 8)) (i32.const 8))
(assert_return (invoke "test" (i32.const 9)) (i32.const 9))
(assert_return (invoke "test" (i32.const 10)) (i32.const 10))
(assert_return (invoke "test" (i32.const 11)) (i32.const 11))
(assert_return (invoke "test" (i32.const 12)) (i32.const 12))
(assert_return (invoke "test" (i32.const 13)) (i32.const 13))
(assert_return (invoke "test" (i32.const 14)) (i32.const 14))
(assert_return (invoke "test" (i32.const 15)) (i32.const 15))
(assert_trap (invoke "test" (i32.const 16)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 17)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 18)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 19)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 20)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 21)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 22)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 23)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 24)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 25)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 26)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 27)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 28)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 29)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 30)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 31)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 32)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 33)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 34)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 35)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 36)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 37)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 38)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 39)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 40)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 41)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 42)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 43)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 44)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 45)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 46)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 47)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 48)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 49)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 50)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 51)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 52)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 53)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 54)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 55)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 56)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 57)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 58)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 59)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 60)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 61)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 62)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 63)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 64)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 65)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 66)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 67)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 68)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 69)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 70)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 71)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 72)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 73)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 74)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 75)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 76)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 77)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 78)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 79)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 80)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 81)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 82)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 83)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 84)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 85)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 86)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 87)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 88)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 89)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 90)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 91)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 92)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 93)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 94)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 95)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 96)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 97)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 98)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 99)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 100)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 101)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 102)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 103)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 104)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 105)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 106)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 107)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 108)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 109)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 110)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 111)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 112)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 113)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 114)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 115)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 116)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 117)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 118)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 119)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 120)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 121)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 122)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 123)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 124)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 125)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 126)) "uninitialized element")
(assert_trap (invoke "test" (i32.const 127)) "uninitialized element")
