diff options
Diffstat (limited to 'test/lit')
-rw-r--r-- | test/lit/heap-types.wast | 101 | ||||
-rw-r--r-- | test/lit/wat-kitchen-sink.wast | 18 |
2 files changed, 119 insertions, 0 deletions
diff --git a/test/lit/heap-types.wast b/test/lit/heap-types.wast index ce7c7814e..9dc8f11a8 100644 --- a/test/lit/heap-types.wast +++ b/test/lit/heap-types.wast @@ -146,3 +146,104 @@ ) ) ) + +(module + ;; CHECK: (type $vector (array (mut f64))) + ;; NOMNL: (type $vector (array (mut f64))) + (type $vector (array (mut f64))) + ;; CHECK: (func $test (type $ref|$vector|_i32_f64_i32_=>_none) (param $ref (ref $vector)) (param $index i32) (param $value f64) (param $size i32) + ;; CHECK-NEXT: (array.fill $vector + ;; CHECK-NEXT: (local.get $ref) + ;; CHECK-NEXT: (local.get $index) + ;; CHECK-NEXT: (local.get $value) + ;; CHECK-NEXT: (local.get $size) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; NOMNL: (func $test (type $ref|$vector|_i32_f64_i32_=>_none) (param $ref (ref $vector)) (param $index i32) (param $value f64) (param $size i32) + ;; NOMNL-NEXT: (array.fill $vector + ;; NOMNL-NEXT: (local.get $ref) + ;; NOMNL-NEXT: (local.get $index) + ;; NOMNL-NEXT: (local.get $value) + ;; NOMNL-NEXT: (local.get $size) + ;; NOMNL-NEXT: ) + ;; NOMNL-NEXT: ) + (func $test (param $ref (ref $vector)) + (param $index i32) + (param $value f64) + (param $size i32) + (array.fill $vector + (local.get $ref) + (local.get $index) + (local.get $value) + (local.get $size) + ) + ) +) + +(module + ;; CHECK: (type $vector (array (mut i32))) + ;; NOMNL: (type $vector (array (mut i32))) + (type $vector (array (mut i32))) + (data "") + ;; CHECK: (func $test (type $ref|$vector|_i32_i32_i32_=>_none) (param $ref (ref $vector)) (param $index i32) (param $offset i32) (param $size i32) + ;; CHECK-NEXT: (array.init_data $vector $0 + ;; CHECK-NEXT: (local.get $ref) + ;; CHECK-NEXT: (local.get $index) + ;; CHECK-NEXT: (local.get $offset) + ;; CHECK-NEXT: (local.get $size) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; NOMNL: (func $test (type $ref|$vector|_i32_i32_i32_=>_none) (param $ref (ref $vector)) (param $index i32) (param $offset i32) (param $size i32) + ;; NOMNL-NEXT: (array.init_data $vector $0 + ;; NOMNL-NEXT: (local.get $ref) + ;; NOMNL-NEXT: (local.get $index) + ;; NOMNL-NEXT: (local.get $offset) + ;; NOMNL-NEXT: (local.get $size) + ;; NOMNL-NEXT: ) + ;; NOMNL-NEXT: ) + (func $test (param $ref (ref $vector)) + (param $index i32) + (param $offset i32) + (param $size i32) + (array.init_data $vector 0 + (local.get $ref) + (local.get $index) + (local.get $offset) + (local.get $size) + ) + ) +) + +(module + ;; CHECK: (type $vector (array (mut funcref))) + ;; NOMNL: (type $vector (array (mut funcref))) + (type $vector (array (mut funcref))) + (elem func) + ;; CHECK: (func $test (type $ref|$vector|_i32_i32_i32_=>_none) (param $ref (ref $vector)) (param $index i32) (param $offset i32) (param $size i32) + ;; CHECK-NEXT: (array.init_elem $vector $0 + ;; CHECK-NEXT: (local.get $ref) + ;; CHECK-NEXT: (local.get $index) + ;; CHECK-NEXT: (local.get $offset) + ;; CHECK-NEXT: (local.get $size) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; NOMNL: (func $test (type $ref|$vector|_i32_i32_i32_=>_none) (param $ref (ref $vector)) (param $index i32) (param $offset i32) (param $size i32) + ;; NOMNL-NEXT: (array.init_elem $vector $0 + ;; NOMNL-NEXT: (local.get $ref) + ;; NOMNL-NEXT: (local.get $index) + ;; NOMNL-NEXT: (local.get $offset) + ;; NOMNL-NEXT: (local.get $size) + ;; NOMNL-NEXT: ) + ;; NOMNL-NEXT: ) + (func $test (param $ref (ref $vector)) + (param $index i32) + (param $offset i32) + (param $size i32) + (array.init_elem $vector 0 + (local.get $ref) + (local.get $index) + (local.get $offset) + (local.get $size) + ) + ) +) diff --git a/test/lit/wat-kitchen-sink.wast b/test/lit/wat-kitchen-sink.wast index 934a77095..37f5fc58d 100644 --- a/test/lit/wat-kitchen-sink.wast +++ b/test/lit/wat-kitchen-sink.wast @@ -97,6 +97,8 @@ ;; CHECK: (type $ref|$a2|_i32_ref|$a2|_i32_i32_=>_none (func (param (ref $a2) i32 (ref $a2) i32 i32))) + ;; CHECK: (type $ref|$a2|_i32_f32_i32_=>_none (func (param (ref $a2) i32 f32 i32))) + ;; CHECK: (rec ;; CHECK-NEXT: (type $s0 (struct )) (type $s0 (sub (struct))) @@ -1627,6 +1629,22 @@ array.copy $a2 $a2 ) + ;; CHECK: (func $array-fill (type $ref|$a2|_i32_f32_i32_=>_none) (param $0 (ref $a2)) (param $1 i32) (param $2 f32) (param $3 i32) + ;; CHECK-NEXT: (array.fill $a2 + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (local.get $2) + ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + (func $array-fill (param (ref $a2) i32 f32 i32) + local.get 0 + local.get 1 + local.get 2 + local.get 3 + array.fill $a2 + ) + ;; CHECK: (func $use-types (type $ref|$s0|_ref|$s1|_ref|$s2|_ref|$s3|_ref|$s4|_ref|$s5|_ref|$s6|_ref|$s7|_ref|$s8|_ref|$a0|_ref|$a1|_ref|$a2|_ref|$a3|_ref|$subvoid|_ref|$submany|_=>_none) (param $0 (ref $s0)) (param $1 (ref $s1)) (param $2 (ref $s2)) (param $3 (ref $s3)) (param $4 (ref $s4)) (param $5 (ref $s5)) (param $6 (ref $s6)) (param $7 (ref $s7)) (param $8 (ref $s8)) (param $9 (ref $a0)) (param $10 (ref $a1)) (param $11 (ref $a2)) (param $12 (ref $a3)) (param $13 (ref $subvoid)) (param $14 (ref $submany)) ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: ) |