summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2023-01-25 15:29:21 -0800
committerGitHub <noreply@github.com>2023-01-25 23:29:21 +0000
commitb5476c6378e10350bf17080fae9bfd8ceeb83cd2 (patch)
tree85dc2d568a7d3dbed85f798a1039065bc6843bb2 /test
parent17d120a3337fe56567d4e45583db8ea62ee8bf6f (diff)
downloadbinaryen-b5476c6378e10350bf17080fae9bfd8ceeb83cd2.tar.gz
binaryen-b5476c6378e10350bf17080fae9bfd8ceeb83cd2.tar.bz2
binaryen-b5476c6378e10350bf17080fae9bfd8ceeb83cd2.zip
[Strings] Add string.compare (#5453)
See WebAssembly/stringref#58
Diffstat (limited to 'test')
-rw-r--r--test/lit/strings.wast25
1 files changed, 23 insertions, 2 deletions
diff --git a/test/lit/strings.wast b/test/lit/strings.wast
index f0b4730d7..22e433479 100644
--- a/test/lit/strings.wast
+++ b/test/lit/strings.wast
@@ -16,10 +16,10 @@
;; CHECK: (type $stringref_=>_none (func (param stringref)))
- ;; CHECK: (type $stringref_stringview_wtf8_stringview_wtf16_stringview_iter_=>_none (func (param stringref stringview_wtf8 stringview_wtf16 stringview_iter)))
-
;; CHECK: (type $stringref_stringref_=>_none (func (param stringref stringref)))
+ ;; CHECK: (type $stringref_stringview_wtf8_stringview_wtf16_stringview_iter_=>_none (func (param stringref stringview_wtf8 stringview_wtf16 stringview_iter)))
+
;; CHECK: (type $array (array (mut i8)))
(type $array (array_subtype (mut i8) data))
;; CHECK: (type $array16 (array (mut i16)))
@@ -250,6 +250,27 @@
)
)
+ ;; CHECK: (func $string.compare (type $stringref_stringref_=>_none) (param $a stringref) (param $b stringref)
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (i32.eqz
+ ;; CHECK-NEXT: (string.compare
+ ;; CHECK-NEXT: (local.get $a)
+ ;; CHECK-NEXT: (local.get $b)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ (func $string.compare (param $a stringref) (param $b stringref)
+ (drop
+ (i32.eqz ;; validate the output is an i32
+ (string.compare
+ (local.get $a)
+ (local.get $b)
+ )
+ )
+ )
+ )
+
;; CHECK: (func $string.is_usv_sequence (type $stringref_=>_none) (param $ref stringref)
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (i32.eqz