Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions test/lit/passes/precompute-strings.wast
Original file line number Diff line number Diff line change
Expand Up @@ -216,15 +216,19 @@
(func $slice (export "slice") (result (ref string))
;; Slicing [3:6] here should definitely output "def".
(stringview_wtf16.slice
(string.const "abcdefgh")
(string.as_wtf16
(string.const "abcdefgh")
)
(i32.const 3)
(i32.const 6)
)
)

;; CHECK: (func $slice-bad (type $2) (result (ref string))
;; CHECK-NEXT: (stringview_wtf16.slice
;; CHECK-NEXT: (string.const "abcd\c2\a3fgh")
;; CHECK-NEXT: (string.as_wtf16
;; CHECK-NEXT: (string.const "abcd\c2\a3fgh")
;; CHECK-NEXT: )
;; CHECK-NEXT: (i32.const 3)
;; CHECK-NEXT: (i32.const 6)
;; CHECK-NEXT: )
Expand All @@ -233,7 +237,9 @@
;; This slice contains non-ascii, so we do not optimize.
(stringview_wtf16.slice
;; abcd£fgh
(string.const "abcd\C2\A3fgh")
(string.as_wtf16
(string.const "abcd\C2\A3fgh")
)
(i32.const 3)
(i32.const 6)
)
Expand Down