diff options
author | Alon Zakai <azakai@google.com> | 2024-03-20 12:40:30 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-20 12:40:30 -0700 |
commit | 70ac213fce134840609190a5d3a18118a089ba8a (patch) | |
tree | eefb41fcd7c3282b1e590a93ae4211e093823d90 /test/lit/passes/precompute-strings.wast | |
parent | f9dc56913085eb7c2565047d87ca84b84a837518 (diff) | |
download | binaryen-70ac213fce134840609190a5d3a18118a089ba8a.tar.gz binaryen-70ac213fce134840609190a5d3a18118a089ba8a.tar.bz2 binaryen-70ac213fce134840609190a5d3a18118a089ba8a.zip |
Strings: Disable precomputing for now (#6412)
Our UTF implementation is still not fully stable it seems as we have reports of
issues. Disable it for now.
Diffstat (limited to 'test/lit/passes/precompute-strings.wast')
-rw-r--r-- | test/lit/passes/precompute-strings.wast | 53 |
1 files changed, 42 insertions, 11 deletions
diff --git a/test/lit/passes/precompute-strings.wast b/test/lit/passes/precompute-strings.wast index c9facfe36..4cd6a8237 100644 --- a/test/lit/passes/precompute-strings.wast +++ b/test/lit/passes/precompute-strings.wast @@ -5,11 +5,11 @@ (module ;; CHECK: (type $0 (func (result i32))) - ;; CHECK: (type $1 (func (result (ref string)))) - ;; CHECK: (type $array16 (array (mut i16))) (type $array16 (array (mut i16))) + ;; CHECK: (type $2 (func (result (ref string)))) + ;; CHECK: (export "get_codepoint-bad" (func $get_codepoint-bad)) ;; CHECK: (export "slice" (func $slice)) @@ -17,7 +17,10 @@ ;; CHECK: (export "slice-bad" (func $slice-bad)) ;; CHECK: (func $eq-no (type $0) (result i32) - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (string.eq + ;; CHECK-NEXT: (string.const "ab") + ;; CHECK-NEXT: (string.const "cdefg") + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $eq-no (result i32) (string.eq @@ -27,7 +30,10 @@ ) ;; CHECK: (func $eq-yes (type $0) (result i32) - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (string.eq + ;; CHECK-NEXT: (string.const "ab") + ;; CHECK-NEXT: (string.const "ab") + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $eq-yes (result i32) (string.eq @@ -37,7 +43,13 @@ ) ;; CHECK: (func $concat (type $0) (result i32) - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (string.eq + ;; CHECK-NEXT: (string.concat + ;; CHECK-NEXT: (string.const "a") + ;; CHECK-NEXT: (string.const "b") + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (string.const "ab") + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $concat (result i32) (string.eq @@ -63,7 +75,11 @@ ) ;; CHECK: (func $length (type $0) (result i32) - ;; CHECK-NEXT: (i32.const 7) + ;; CHECK-NEXT: (stringview_wtf16.length + ;; CHECK-NEXT: (string.as_wtf16 + ;; CHECK-NEXT: (string.const "1234567") + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $length (result i32) (stringview_wtf16.length @@ -91,7 +107,12 @@ ) ;; CHECK: (func $get_codepoint (type $0) (result i32) - ;; CHECK-NEXT: (i32.const 95) + ;; CHECK-NEXT: (stringview_wtf16.get_codeunit + ;; CHECK-NEXT: (string.as_wtf16 + ;; CHECK-NEXT: (string.const "$_\c2\a3_\e2\82\ac_\f0\90\8d\88") + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $get_codepoint (result i32) ;; This is computable because everything up to the requested index is ascii. Returns 95 ('_'). @@ -124,7 +145,13 @@ ) ;; CHECK: (func $encode (type $0) (result i32) - ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: (string.encode_wtf16_array + ;; CHECK-NEXT: (string.const "$_") + ;; CHECK-NEXT: (array.new_default $array16 + ;; CHECK-NEXT: (i32.const 20) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $encode (result i32) (string.encode_wtf16_array @@ -156,8 +183,12 @@ ) ) - ;; CHECK: (func $slice (type $1) (result (ref string)) - ;; CHECK-NEXT: (string.const "def") + ;; CHECK: (func $slice (type $2) (result (ref string)) + ;; CHECK-NEXT: (stringview_wtf16.slice + ;; CHECK-NEXT: (string.const "abcdefgh") + ;; CHECK-NEXT: (i32.const 3) + ;; CHECK-NEXT: (i32.const 6) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $slice (export "slice") (result (ref string)) ;; Slicing [3:6] here should definitely output "def". @@ -168,7 +199,7 @@ ) ) - ;; CHECK: (func $slice-bad (type $1) (result (ref string)) + ;; CHECK: (func $slice-bad (type $2) (result (ref string)) ;; CHECK-NEXT: (stringview_wtf16.slice ;; CHECK-NEXT: (string.const "abcd\c2\a3fgh") ;; CHECK-NEXT: (i32.const 3) |