<commit_before>(module
  (type (func (param i32 i32 i32 i32) (result i32)))
  (type (func))

  ;; import fd_read, this is fine.
  (func $read (import "wasi_snapshot_preview1" "fd_read") (type 0))

  ;; import fd_write, this is also fine.
  (func $write (import "wasi_snapshot_preview1" "fd_write") (type 0))

  ;; import fd_read, again, under a different name!
  ;; this is to test that we join together the imports.
  ;; the .wat would be invalid if their types disagree, so there
  ;; is no observable difference between $read and $read_2
  (func $read_2 (import "wasi_snapshot_preview1" "fd_read") (type 0))

  ;; import fd_write again for grins.
  (import "wasi_snapshot_preview1" "fd_write" (func (type 0)))
  (memory 1)
  (data (i32.const 0) "duplicate import works!\0a")
  (data (i32.const 64) "\00\00\00\00\18\00\00\00")

  (func $_setup (type 1)
    (drop (call $write (i32.const 1) (i32.const 64) (i32.const 1) (i32.const 0))))

  ;; declare that, actually, one of the imported functions is exported
  (export "read_2" (func $read_2))
  ;; and declare that the *other* read function is also exported, by a
  ;; different name. This lets us check that when we merge the functions,
  ;; we also merge their export names properly.
  (export "read" (func $read))

  ;; and check that other exported functions still work, and are not affected
  (export "write" (func $write))

  ;; and that we can export local functions without issue
  (export "_start" (func $_setup))
)
<commit_msg>lucet-wasi tests: don't put string at location 0, thats NULL<commit_after>(module
  (type (func (param i32 i32 i32 i32) (result i32)))
  (type (func))

  ;; import fd_read, this is fine.
  (func $read (import "wasi_snapshot_preview1" "fd_read") (type 0))

  ;; import fd_write, this is also fine.
  (func $write (import "wasi_snapshot_preview1" "fd_write") (type 0))

  ;; import fd_read, again, under a different name!
  ;; this is to test that we join together the imports.
  ;; the .wat would be invalid if their types disagree, so there
  ;; is no observable difference between $read and $read_2
  (func $read_2 (import "wasi_snapshot_preview1" "fd_read") (type 0))

  ;; import fd_write again for grins.
  (import "wasi_snapshot_preview1" "fd_write" (func (type 0)))
  (memory 1)
  (data (i32.const 4) "duplicate import works!\0a")
  (data (i32.const 64) "\04\00\00\00\18\00\00\00")

  (func $_setup (type 1)
    (drop (call $write (i32.const 1) (i32.const 64) (i32.const 1) (i32.const 0))))

  ;; declare that, actually, one of the imported functions is exported
  (export "read_2" (func $read_2))
  ;; and declare that the *other* read function is also exported, by a
  ;; different name. This lets us check that when we merge the functions,
  ;; we also merge their export names properly.
  (export "read" (func $read))

  ;; and check that other exported functions still work, and are not affected
  (export "write" (func $write))

  ;; and that we can export local functions without issue
  (export "_start" (func $_setup))
)

{'fraction_non_alphanumeric': 0.12297520661157024, 'fraction_numerical': 0.040661157024793386, 'mean_word_length': 3.985172981878089, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2969592', 'n_tokens_mistral': 1104, 'n_tokens_neox': 990, 'n_words': 401}