table.wast 1.1 KB

123456789101112131415161718192021222324252627282930
  1. ;;-------------------------------------------------------------------------------------------------------
  2. ;; Copyright (C) Microsoft Corporation and contributors. All rights reserved.
  3. ;; Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
  4. ;;-------------------------------------------------------------------------------------------------------
  5. (module $Nt
  6. (type (func))
  7. (type (func (result i32)))
  8. (global $x (import "m" "x") i32)
  9. (global $a i32 (i32.const 6))
  10. (table 15 anyfunc)
  11. (elem (i32.const 1) $g1 $g2 $g3 $g4) ;;local offset
  12. (elem (get_global $x) $g3 $g4 $g5 $g6) ;;imported global offset
  13. ;;(elem (get_global $a) $g5 $g6 $g7 $g8) ;;global offset
  14. (func $g1 (result i32) (i32.const 15))
  15. (func $g2 (result i32) (i32.const 25))
  16. (func $g3 (result i32) (i32.const 35))
  17. (func $g4 (result i32) (i32.const 45))
  18. (func $g5 (result i32) (i32.const 55))
  19. (func $g6 (result i32) (i32.const 65))
  20. (func $g7 (result i32) (i32.const 75))
  21. (func $g8 (result i32) (i32.const 85))
  22. (func (export "call") (param i32) (result i32)
  23. (call_indirect 1 (get_local 0))
  24. )
  25. )