diff options
Diffstat (limited to 'test/lit/passes/string-gathering.wast')
-rw-r--r-- | test/lit/passes/string-gathering.wast | 64 |
1 files changed, 54 insertions, 10 deletions
diff --git a/test/lit/passes/string-gathering.wast b/test/lit/passes/string-gathering.wast index 8c315ddc1..a7d0418ec 100644 --- a/test/lit/passes/string-gathering.wast +++ b/test/lit/passes/string-gathering.wast @@ -27,11 +27,21 @@ ;; CHECK: (global $global2 stringref (global.get $string.const_bar)) ;; LOWER: (type $0 (func)) - ;; LOWER: (type $1 (array (mut i16))) + ;; LOWER: (type $1 (func (param externref externref) (result i32))) - ;; LOWER: (type $2 (func (param (ref null $1) i32 i32) (result (ref extern)))) + ;; LOWER: (type $2 (array (mut i16))) - ;; LOWER: (type $3 (func (param i32) (result (ref extern)))) + ;; LOWER: (type $3 (func (param (ref null $2) i32 i32) (result (ref extern)))) + + ;; LOWER: (type $4 (func (param i32) (result (ref extern)))) + + ;; LOWER: (type $5 (func (param externref (ref null $2) i32) (result i32))) + + ;; LOWER: (type $6 (func (param externref) (result i32))) + + ;; LOWER: (type $7 (func (param externref i32) (result i32))) + + ;; LOWER: (type $8 (func (param externref i32 i32) (result (ref extern)))) ;; LOWER: (import "string.const" "0" (global $string.const_bar (ref extern))) @@ -39,9 +49,21 @@ ;; LOWER: (import "string.const" "2" (global $global (ref extern))) - ;; LOWER: (import "wasm:js-string" "fromCharCodeArray" (func $fromCharCodeArray (type $2) (param (ref null $1) i32 i32) (result (ref extern)))) + ;; LOWER: (import "wasm:js-string" "fromCharCodeArray" (func $fromCharCodeArray (type $3) (param (ref null $2) i32 i32) (result (ref extern)))) - ;; LOWER: (import "wasm:js-string" "fromCodePoint" (func $fromCodePoint (type $3) (param i32) (result (ref extern)))) + ;; LOWER: (import "wasm:js-string" "fromCodePoint" (func $fromCodePoint (type $4) (param i32) (result (ref extern)))) + + ;; LOWER: (import "wasm:js-string" "intoCharCodeArray" (func $intoCharCodeArray (type $5) (param externref (ref null $2) i32) (result i32))) + + ;; LOWER: (import "wasm:js-string" "equals" (func $equals (type $1) (param externref externref) (result i32))) + + ;; LOWER: (import "wasm:js-string" "compare" (func $compare (type $1) (param externref externref) (result i32))) + + ;; LOWER: (import "wasm:js-string" "length" (func $length (type $6) (param externref) (result i32))) + + ;; LOWER: (import "wasm:js-string" "codePointAt" (func $codePointAt (type $7) (param externref i32) (result i32))) + + ;; LOWER: (import "wasm:js-string" "substring" (func $substring (type $8) (param externref i32 i32) (result (ref extern)))) ;; LOWER: (global $global2 externref (global.get $string.const_bar)) (global $global2 (ref null string) (string.const "bar")) @@ -121,11 +143,21 @@ ;; Multiple possible reusable globals. Also test ignoring of imports. (module ;; CHECK: (import "a" "b" (global $import (ref string))) - ;; LOWER: (type $0 (array (mut i16))) + ;; LOWER: (type $0 (func (param externref externref) (result i32))) - ;; LOWER: (type $1 (func (param (ref null $0) i32 i32) (result (ref extern)))) + ;; LOWER: (type $1 (array (mut i16))) + + ;; LOWER: (type $2 (func (param (ref null $1) i32 i32) (result (ref extern)))) + + ;; LOWER: (type $3 (func (param i32) (result (ref extern)))) + + ;; LOWER: (type $4 (func (param externref (ref null $1) i32) (result i32))) + + ;; LOWER: (type $5 (func (param externref) (result i32))) + + ;; LOWER: (type $6 (func (param externref i32) (result i32))) - ;; LOWER: (type $2 (func (param i32) (result (ref extern)))) + ;; LOWER: (type $7 (func (param externref i32 i32) (result (ref extern)))) ;; LOWER: (import "a" "b" (global $import (ref extern))) (import "a" "b" (global $import (ref string))) @@ -138,9 +170,21 @@ ;; LOWER: (import "string.const" "1" (global $global4 (ref extern))) - ;; LOWER: (import "wasm:js-string" "fromCharCodeArray" (func $fromCharCodeArray (type $1) (param (ref null $0) i32 i32) (result (ref extern)))) + ;; LOWER: (import "wasm:js-string" "fromCharCodeArray" (func $fromCharCodeArray (type $2) (param (ref null $1) i32 i32) (result (ref extern)))) + + ;; LOWER: (import "wasm:js-string" "fromCodePoint" (func $fromCodePoint (type $3) (param i32) (result (ref extern)))) + + ;; LOWER: (import "wasm:js-string" "intoCharCodeArray" (func $intoCharCodeArray (type $4) (param externref (ref null $1) i32) (result i32))) + + ;; LOWER: (import "wasm:js-string" "equals" (func $equals (type $0) (param externref externref) (result i32))) + + ;; LOWER: (import "wasm:js-string" "compare" (func $compare (type $0) (param externref externref) (result i32))) + + ;; LOWER: (import "wasm:js-string" "length" (func $length (type $5) (param externref) (result i32))) + + ;; LOWER: (import "wasm:js-string" "codePointAt" (func $codePointAt (type $6) (param externref i32) (result i32))) - ;; LOWER: (import "wasm:js-string" "fromCodePoint" (func $fromCodePoint (type $2) (param i32) (result (ref extern)))) + ;; LOWER: (import "wasm:js-string" "substring" (func $substring (type $7) (param externref i32 i32) (result (ref extern)))) ;; LOWER: (global $global2 (ref extern) (global.get $global1)) (global $global2 (ref string) (string.const "foo")) |