summaryrefslogtreecommitdiff
path: root/test/lit/passes/string-lowering-instructions.wast
diff options
context:
space:
mode:
Diffstat (limited to 'test/lit/passes/string-lowering-instructions.wast')
-rw-r--r--test/lit/passes/string-lowering-instructions.wast53
1 files changed, 36 insertions, 17 deletions
diff --git a/test/lit/passes/string-lowering-instructions.wast b/test/lit/passes/string-lowering-instructions.wast
index 97186fba7..548586c4b 100644
--- a/test/lit/passes/string-lowering-instructions.wast
+++ b/test/lit/passes/string-lowering-instructions.wast
@@ -50,21 +50,25 @@
;; CHECK: (type $17 (func (param externref (ref $0)) (result i32)))
- ;; CHECK: (type $18 (func (param (ref $0))))
+ ;; CHECK: (type $18 (func (param externref externref) (result (ref extern))))
- ;; CHECK: (type $19 (func (param externref (ref extern) externref externref externref (ref extern))))
+ ;; CHECK: (type $19 (func (param (ref $0))))
- ;; CHECK: (type $20 (func (param (ref null $0) i32 i32) (result (ref extern))))
+ ;; CHECK: (type $20 (func (param externref (ref extern) externref externref externref (ref extern))))
- ;; CHECK: (type $21 (func (param i32) (result (ref extern))))
+ ;; CHECK: (type $21 (func (param (ref null $0) i32 i32) (result (ref extern))))
- ;; CHECK: (type $22 (func (param externref (ref null $0) i32) (result i32)))
+ ;; CHECK: (type $22 (func (param i32) (result (ref extern))))
- ;; CHECK: (type $23 (func (param externref) (result i32)))
+ ;; CHECK: (type $23 (func (param externref externref) (result (ref extern))))
- ;; CHECK: (type $24 (func (param externref i32) (result i32)))
+ ;; CHECK: (type $24 (func (param externref (ref null $0) i32) (result i32)))
- ;; CHECK: (type $25 (func (param externref i32 i32) (result (ref extern))))
+ ;; CHECK: (type $25 (func (param externref) (result i32)))
+
+ ;; CHECK: (type $26 (func (param externref i32) (result i32)))
+
+ ;; CHECK: (type $27 (func (param externref i32 i32) (result (ref extern))))
;; CHECK: (import "string.const" "0" (global $string.const_exported (ref extern)))
@@ -74,21 +78,23 @@
(import "colliding" "name" (func $fromCodePoint))
- ;; CHECK: (import "wasm:js-string" "fromCharCodeArray" (func $fromCharCodeArray (type $20) (param (ref null $0) i32 i32) (result (ref extern))))
+ ;; CHECK: (import "wasm:js-string" "fromCharCodeArray" (func $fromCharCodeArray (type $21) (param (ref null $0) i32 i32) (result (ref extern))))
- ;; CHECK: (import "wasm:js-string" "fromCodePoint" (func $fromCodePoint_18 (type $21) (param i32) (result (ref extern))))
+ ;; CHECK: (import "wasm:js-string" "fromCodePoint" (func $fromCodePoint_19 (type $22) (param i32) (result (ref extern))))
- ;; CHECK: (import "wasm:js-string" "intoCharCodeArray" (func $intoCharCodeArray (type $22) (param externref (ref null $0) i32) (result i32)))
+ ;; CHECK: (import "wasm:js-string" "concat" (func $concat (type $23) (param externref externref) (result (ref extern))))
+
+ ;; CHECK: (import "wasm:js-string" "intoCharCodeArray" (func $intoCharCodeArray (type $24) (param externref (ref null $0) i32) (result i32)))
;; CHECK: (import "wasm:js-string" "equals" (func $equals (type $2) (param externref externref) (result i32)))
;; CHECK: (import "wasm:js-string" "compare" (func $compare (type $2) (param externref externref) (result i32)))
- ;; CHECK: (import "wasm:js-string" "length" (func $length (type $23) (param externref) (result i32)))
+ ;; CHECK: (import "wasm:js-string" "length" (func $length (type $25) (param externref) (result i32)))
- ;; CHECK: (import "wasm:js-string" "charCodeAt" (func $charCodeAt (type $24) (param externref i32) (result i32)))
+ ;; CHECK: (import "wasm:js-string" "charCodeAt" (func $charCodeAt (type $26) (param externref i32) (result i32)))
- ;; CHECK: (import "wasm:js-string" "substring" (func $substring (type $25) (param externref i32 i32) (result (ref extern))))
+ ;; CHECK: (import "wasm:js-string" "substring" (func $substring (type $27) (param externref i32 i32) (result (ref extern))))
;; CHECK: (global $string externref (ref.null noextern))
(global $string stringref (ref.null string)) ;; Test we update global nulls.
@@ -97,7 +103,7 @@
;; CHECK: (export "export.2" (func $exported-string-receiver))
- ;; CHECK: (func $string.as (type $19) (param $a externref) (param $a_nn (ref extern)) (param $b externref) (param $c externref) (param $d externref) (param $nn_view (ref extern))
+ ;; CHECK: (func $string.as (type $20) (param $a externref) (param $a_nn (ref extern)) (param $b externref) (param $c externref) (param $d externref) (param $nn_view (ref extern))
;; CHECK-NEXT: (local.set $b
;; CHECK-NEXT: (ref.as_non_null
;; CHECK-NEXT: (local.get $a)
@@ -163,7 +169,7 @@
)
)
- ;; CHECK: (func $string.new.gc (type $18) (param $array16 (ref $0))
+ ;; CHECK: (func $string.new.gc (type $19) (param $array16 (ref $0))
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (call $fromCharCodeArray
;; CHECK-NEXT: (local.get $array16)
@@ -183,7 +189,7 @@
)
;; CHECK: (func $string.from_code_point (type $4) (result externref)
- ;; CHECK-NEXT: (call $fromCodePoint_18
+ ;; CHECK-NEXT: (call $fromCodePoint_19
;; CHECK-NEXT: (i32.const 1)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
@@ -193,6 +199,19 @@
)
)
+ ;; CHECK: (func $string.concat (type $18) (param $0 externref) (param $1 externref) (result (ref extern))
+ ;; CHECK-NEXT: (call $concat
+ ;; CHECK-NEXT: (local.get $0)
+ ;; CHECK-NEXT: (local.get $1)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ (func $string.concat (param stringref stringref) (result (ref string))
+ (string.concat
+ (local.get 0)
+ (local.get 1)
+ )
+ )
+
;; CHECK: (func $string.encode (type $17) (param $ref externref) (param $array16 (ref $0)) (result i32)
;; CHECK-NEXT: (call $intoCharCodeArray
;; CHECK-NEXT: (local.get $ref)