test.wast 410 B

123456789101112131415
  1. (module
  2. (data $string_data "asdf")
  3. (func $print (import "spectest" "print_i32") (param $i i32))
  4. (memory $memory (export "memory") 1)
  5. (type $string (array (mut i8)))
  6. (func $init
  7. (local $str (ref null $string))
  8. (array.new_data $string $string_data (i32.const 0) (i32.const 4))
  9. (local.tee $str)
  10. (ref.as_non_null)
  11. (array.len)
  12. (call $print)
  13. )
  14. (export "_start" (func $init))
  15. )