diff options
author | Alon Zakai <azakai@google.com> | 2022-07-08 13:37:50 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-08 13:37:50 -0700 |
commit | fea11e95c67d51c464f00a5fcdfa6adb2c596f5e (patch) | |
tree | 1d4c310461568a66f43391389d7cff345d8615c7 /test | |
parent | 75d059ad249b9dcedbaaf858747d60d299269d2c (diff) | |
download | binaryen-fea11e95c67d51c464f00a5fcdfa6adb2c596f5e.tar.gz binaryen-fea11e95c67d51c464f00a5fcdfa6adb2c596f5e.tar.bz2 binaryen-fea11e95c67d51c464f00a5fcdfa6adb2c596f5e.zip |
[Strings] string.is_usv_sequence (#4783)
This implements it as a StringMeasure opcode. They do have the same number of
operands, same trapping behavior, and same return type. They both get a string and
do some inspection of it to return an i32. Perhaps the name could be StringInspect
or something like that, rather than StringMeasure..? But I think for now this might be
good enough, and the spec may change anyhow later.
Diffstat (limited to 'test')
-rw-r--r-- | test/lit/strings.wast | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/lit/strings.wast b/test/lit/strings.wast index 687de8e3d..d1a9fd053 100644 --- a/test/lit/strings.wast +++ b/test/lit/strings.wast @@ -225,4 +225,23 @@ ) ) ) + + ;; CHECK: (func $string.is_usv_sequence (param $ref stringref) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (i32.eqz + ;; CHECK-NEXT: (string.is_usv_sequence + ;; CHECK-NEXT: (local.get $ref) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + (func $string.is_usv_sequence (param $ref stringref) + (drop + (i32.eqz ;; validate the output is i32 + (string.is_usv_sequence + (local.get $ref) + ) + ) + ) + ) ) |