diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/lit/basic/shared-types.wast | 47 | ||||
-rw-r--r-- | test/lit/passes/type-merging-shared.wast | 9 |
2 files changed, 53 insertions, 3 deletions
diff --git a/test/lit/basic/shared-types.wast b/test/lit/basic/shared-types.wast new file mode 100644 index 000000000..d3720c2e9 --- /dev/null +++ b/test/lit/basic/shared-types.wast @@ -0,0 +1,47 @@ +;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited. + +;; RUN: wasm-opt %s -all -S -o - | filecheck %s +;; RUN: wasm-opt %s -all --roundtrip -S -o - | filecheck %s + +(module + (rec + ;; CHECK: (rec + ;; CHECK-NEXT: (type $final (shared (struct ))) + (type $final (shared (struct))) + ;; CHECK: (type $top (sub (shared (struct )))) + (type $top (sub (shared (struct)))) + ;; CHECK: (type $mid (sub $top (shared (struct (field i32))))) + (type $mid (sub $top (shared (struct i32)))) + ;; CHECK: (type $bot (sub final $mid (shared (struct (field i32) (field i32))))) + (type $bot (sub final $mid (shared (struct i32 i32)))) + + ;; CHECK: (type $func (shared (func))) + (type $func (shared (func))) + ;; CHECK: (type $array (shared (array i8))) + (type $array (shared (array i8))) + ;; CHECK: (type $cont (shared (cont $func))) + (type $cont (shared (cont $func))) + ) + + ;; CHECK: (type $7 (func)) + + ;; CHECK: (func $use-types (type $7) + ;; CHECK-NEXT: (local $0 (ref $final)) + ;; CHECK-NEXT: (local $1 (ref $top)) + ;; CHECK-NEXT: (local $2 (ref $mid)) + ;; CHECK-NEXT: (local $3 (ref $bot)) + ;; CHECK-NEXT: (local $4 (ref $func)) + ;; CHECK-NEXT: (local $5 (ref $array)) + ;; CHECK-NEXT: (local $6 (ref $cont)) + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) + (func $use-types + (local (ref $final)) + (local (ref $top)) + (local (ref $mid)) + (local (ref $bot)) + (local (ref $func)) + (local (ref $array)) + (local (ref $cont)) + ) +) diff --git a/test/lit/passes/type-merging-shared.wast b/test/lit/passes/type-merging-shared.wast index aefeccc3b..2d3bcdc21 100644 --- a/test/lit/passes/type-merging-shared.wast +++ b/test/lit/passes/type-merging-shared.wast @@ -43,18 +43,21 @@ (module ;; But two shared types can be merged. ;; CHECK: (rec - ;; CHECK-NEXT: (type $B (shared (array i8))) + ;; CHECK-NEXT: (type $C (shared (func))) + + ;; CHECK: (type $B (shared (array i8))) ;; CHECK: (type $A (shared (struct ))) (type $A (shared (struct))) (type $A' (shared (struct))) (type $B (shared (array i8))) (type $B' (shared (array i8))) - ;; CHECK: (type $C (shared (func))) (type $C (shared (func))) (type $C' (shared (func))) - ;; CHECK: (func $foo (type $C) + ;; CHECK: (type $3 (func)) + + ;; CHECK: (func $foo (type $3) ;; CHECK-NEXT: (local $a (ref null $A)) ;; CHECK-NEXT: (local $a' (ref null $A)) ;; CHECK-NEXT: (local $b (ref null $B)) |