summaryrefslogtreecommitdiff
path: root/test/lit/exec/strings.wast
blob: 2852337c8ba1fe5e8e6964578c78a824bc254059 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
;; NOTE: Assertions have been generated by update_lit_checks.py --output=fuzz-exec and should not be edited.

;; RUN: wasm-opt %s -all --fuzz-exec -q -o /dev/null 2>&1 | filecheck %s

(module
  (type $array16 (array (mut i16)))

  ;; CHECK:      [fuzz-exec] calling new_wtf16_array
  ;; CHECK-NEXT: [fuzz-exec] note result: new_wtf16_array => string("ello")
  (func "new_wtf16_array" (result stringref)
    (string.new_wtf16_array
      (array.init_static $array16
        (i32.const 104) ;; h
        (i32.const 101) ;; e
        (i32.const 108) ;; l
        (i32.const 108) ;; l
        (i32.const 111) ;; o
      )
      (i32.const 1) ;; start from index 1, to chop off the 'h'
      (i32.const 5)
    )
  )

  ;; CHECK:      [fuzz-exec] calling const
  ;; CHECK-NEXT: [fuzz-exec] note result: const => string("world")
  (func "const" (result stringref)
    (string.const "world")
  )
)
;; CHECK:      [fuzz-exec] calling new_wtf16_array
;; CHECK-NEXT: [fuzz-exec] note result: new_wtf16_array => string("ello")

;; CHECK:      [fuzz-exec] calling const
;; CHECK-NEXT: [fuzz-exec] note result: const => string("world")
;; CHECK-NEXT: [fuzz-exec] comparing const
;; CHECK-NEXT: [fuzz-exec] comparing new_wtf16_array