blob: 372439e9fe1ff2baa432323d9c1daea62ae53fe2 [file] [log] [blame] [edit]
;; NOTE: Assertions have been generated by update_lit_checks.py and should not be edited.
;; RUN: wasm-opt %s -all --string-lowering --no-validation -S -o - | filecheck %s --check-prefix=LOWER
;; RUN: wasm-opt %s -all --string-lowering --string-lifting --no-validation -S -o - | filecheck %s --check-prefix=LIFT
(module
;; LOWER: (rec
;; LOWER-NEXT: (type $shared-array16 (shared (array (mut i16))))
;; LIFT: (rec
;; LIFT-NEXT: (type $shared-array16 (shared (array (mut i16))))
(type $shared-array16 (shared (array (mut i16))))
;; LOWER: (func $new-shared (type $10) (param $a (ref $shared-array16)) (result (ref (shared extern)))
;; LOWER-NEXT: (call $fromCharCodeArray_14
;; LOWER-NEXT: (local.get $a)
;; LOWER-NEXT: (i32.const 0)
;; LOWER-NEXT: (i32.const 1)
;; LOWER-NEXT: )
;; LOWER-NEXT: )
;; LIFT: (func $new-shared (type $10) (param $a (ref $shared-array16)) (result (ref (shared extern)))
;; LIFT-NEXT: (string.new_wtf16_array
;; LIFT-NEXT: (local.get $a)
;; LIFT-NEXT: (i32.const 0)
;; LIFT-NEXT: (i32.const 1)
;; LIFT-NEXT: )
;; LIFT-NEXT: )
(func $new-shared (param $a (ref $shared-array16)) (result (ref (shared string)))
(string.new_wtf16_array (local.get $a) (i32.const 0) (i32.const 1))
)
;; LOWER: (func $concat-shared (type $9) (param $a (ref (shared extern))) (param $b (ref (shared extern))) (result (ref (shared extern)))
;; LOWER-NEXT: (call $concat_16
;; LOWER-NEXT: (local.get $a)
;; LOWER-NEXT: (local.get $b)
;; LOWER-NEXT: )
;; LOWER-NEXT: )
;; LIFT: (func $concat-shared (type $9) (param $a (ref (shared extern))) (param $b (ref (shared extern))) (result (ref (shared extern)))
;; LIFT-NEXT: (string.concat
;; LIFT-NEXT: (local.get $a)
;; LIFT-NEXT: (local.get $b)
;; LIFT-NEXT: )
;; LIFT-NEXT: )
(func $concat-shared (param $a (ref (shared string))) (param $b (ref (shared string))) (result (ref (shared string)))
(string.concat (local.get $a) (local.get $b))
)
;; LOWER: (func $eq-shared (type $8) (param $a (ref (shared extern))) (param $b (ref (shared extern))) (result i32)
;; LOWER-NEXT: (call $equals_18
;; LOWER-NEXT: (local.get $a)
;; LOWER-NEXT: (local.get $b)
;; LOWER-NEXT: )
;; LOWER-NEXT: )
;; LIFT: (func $eq-shared (type $8) (param $a (ref (shared extern))) (param $b (ref (shared extern))) (result i32)
;; LIFT-NEXT: (string.eq
;; LIFT-NEXT: (local.get $a)
;; LIFT-NEXT: (local.get $b)
;; LIFT-NEXT: )
;; LIFT-NEXT: )
(func $eq-shared (param $a (ref (shared string))) (param $b (ref (shared string))) (result i32)
(string.eq (local.get $a) (local.get $b))
)
;; LOWER: (func $length-shared (type $7) (param $a (ref (shared extern))) (result i32)
;; LOWER-NEXT: (call $length_21
;; LOWER-NEXT: (local.get $a)
;; LOWER-NEXT: )
;; LOWER-NEXT: )
;; LIFT: (func $length-shared (type $7) (param $a (ref (shared extern))) (result i32)
;; LIFT-NEXT: (string.measure_wtf16
;; LIFT-NEXT: (local.get $a)
;; LIFT-NEXT: )
;; LIFT-NEXT: )
(func $length-shared (param $a (ref (shared string))) (result i32)
(string.measure_wtf16 (local.get $a))
)
)