| ;; NOTE: Assertions have been generated by update_lit_checks.py and should not be edited. |
| ;; RUN: wasm-opt %s -all -S -o - | filecheck %s |
| ;; RUN: wasm-opt %s -all --roundtrip -S -o - | filecheck %s --check-prefix=RTRIP |
| |
| (module |
| ;; CHECK: (type $struct (struct (field i32))) |
| ;; RTRIP: (type $struct (struct (field i32))) |
| (type $struct (struct (field i32))) |
| ;; CHECK: (type $shared-struct (shared (struct (field (mut i32))))) |
| ;; RTRIP: (type $shared-struct (shared (struct (field (mut i32))))) |
| (type $shared-struct (shared (struct (field (mut i32))))) |
| ;; CHECK: (type $array (array (mut i8))) |
| ;; RTRIP: (type $array (array (mut i8))) |
| (type $array (array (mut i8))) |
| ;; CHECK: (type $shared-array (shared (array (mut i8)))) |
| ;; RTRIP: (type $shared-array (shared (array (mut i8)))) |
| (type $shared-array (shared (array (mut i8)))) |
| |
| ;; CHECK: (func $publish-struct (type $4) (param $x (ref $struct)) (result (ref $struct)) |
| ;; CHECK-NEXT: (publish |
| ;; CHECK-NEXT: (local.get $x) |
| ;; CHECK-NEXT: ) |
| ;; CHECK-NEXT: ) |
| ;; RTRIP: (func $publish-struct (type $4) (param $x (ref $struct)) (result (ref $struct)) |
| ;; RTRIP-NEXT: (publish |
| ;; RTRIP-NEXT: (local.get $x) |
| ;; RTRIP-NEXT: ) |
| ;; RTRIP-NEXT: ) |
| (func $publish-struct (param $x (ref $struct)) (result (ref $struct)) |
| (publish |
| (local.get $x) |
| ) |
| ) |
| |
| ;; CHECK: (func $publish-shared-struct (type $5) (param $x (ref null $shared-struct)) (result (ref null $shared-struct)) |
| ;; CHECK-NEXT: (publish |
| ;; CHECK-NEXT: (local.get $x) |
| ;; CHECK-NEXT: ) |
| ;; CHECK-NEXT: ) |
| ;; RTRIP: (func $publish-shared-struct (type $5) (param $x (ref null $shared-struct)) (result (ref null $shared-struct)) |
| ;; RTRIP-NEXT: (publish |
| ;; RTRIP-NEXT: (local.get $x) |
| ;; RTRIP-NEXT: ) |
| ;; RTRIP-NEXT: ) |
| (func $publish-shared-struct (param $x (ref null $shared-struct)) (result (ref null $shared-struct)) |
| (publish |
| (local.get $x) |
| ) |
| ) |
| |
| ;; CHECK: (func $publish-array (type $6) (param $x (ref $array)) (result (ref $array)) |
| ;; CHECK-NEXT: (publish |
| ;; CHECK-NEXT: (local.get $x) |
| ;; CHECK-NEXT: ) |
| ;; CHECK-NEXT: ) |
| ;; RTRIP: (func $publish-array (type $6) (param $x (ref $array)) (result (ref $array)) |
| ;; RTRIP-NEXT: (publish |
| ;; RTRIP-NEXT: (local.get $x) |
| ;; RTRIP-NEXT: ) |
| ;; RTRIP-NEXT: ) |
| (func $publish-array (param $x (ref $array)) (result (ref $array)) |
| (publish |
| (local.get $x) |
| ) |
| ) |
| |
| ;; CHECK: (func $publish-shared-array (type $7) (param $x (ref null $shared-array)) (result (ref null $shared-array)) |
| ;; CHECK-NEXT: (publish |
| ;; CHECK-NEXT: (local.get $x) |
| ;; CHECK-NEXT: ) |
| ;; CHECK-NEXT: ) |
| ;; RTRIP: (func $publish-shared-array (type $7) (param $x (ref null $shared-array)) (result (ref null $shared-array)) |
| ;; RTRIP-NEXT: (publish |
| ;; RTRIP-NEXT: (local.get $x) |
| ;; RTRIP-NEXT: ) |
| ;; RTRIP-NEXT: ) |
| (func $publish-shared-array (param $x (ref null $shared-array)) (result (ref null $shared-array)) |
| (publish |
| (local.get $x) |
| ) |
| ) |
| |
| ;; CHECK: (func $publish-any (type $8) (param $x anyref) (result anyref) |
| ;; CHECK-NEXT: (publish |
| ;; CHECK-NEXT: (local.get $x) |
| ;; CHECK-NEXT: ) |
| ;; CHECK-NEXT: ) |
| ;; RTRIP: (func $publish-any (type $8) (param $x anyref) (result anyref) |
| ;; RTRIP-NEXT: (publish |
| ;; RTRIP-NEXT: (local.get $x) |
| ;; RTRIP-NEXT: ) |
| ;; RTRIP-NEXT: ) |
| (func $publish-any (param $x anyref) (result anyref) |
| (publish |
| (local.get $x) |
| ) |
| ) |
| |
| ;; CHECK: (func $publish-eq (type $9) (param $x eqref) (result eqref) |
| ;; CHECK-NEXT: (publish |
| ;; CHECK-NEXT: (local.get $x) |
| ;; CHECK-NEXT: ) |
| ;; CHECK-NEXT: ) |
| ;; RTRIP: (func $publish-eq (type $9) (param $x eqref) (result eqref) |
| ;; RTRIP-NEXT: (publish |
| ;; RTRIP-NEXT: (local.get $x) |
| ;; RTRIP-NEXT: ) |
| ;; RTRIP-NEXT: ) |
| (func $publish-eq (param $x eqref) (result eqref) |
| (publish |
| (local.get $x) |
| ) |
| ) |
| |
| ;; CHECK: (func $publish-i31 (type $10) (param $x (ref i31)) (result (ref i31)) |
| ;; CHECK-NEXT: (publish |
| ;; CHECK-NEXT: (local.get $x) |
| ;; CHECK-NEXT: ) |
| ;; CHECK-NEXT: ) |
| ;; RTRIP: (func $publish-i31 (type $10) (param $x (ref i31)) (result (ref i31)) |
| ;; RTRIP-NEXT: (publish |
| ;; RTRIP-NEXT: (local.get $x) |
| ;; RTRIP-NEXT: ) |
| ;; RTRIP-NEXT: ) |
| (func $publish-i31 (param $x (ref i31)) (result (ref i31)) |
| (publish |
| (local.get $x) |
| ) |
| ) |
| |
| ;; CHECK: (func $publish-extern (type $11) (param $x externref) (result externref) |
| ;; CHECK-NEXT: (publish |
| ;; CHECK-NEXT: (local.get $x) |
| ;; CHECK-NEXT: ) |
| ;; CHECK-NEXT: ) |
| ;; RTRIP: (func $publish-extern (type $11) (param $x externref) (result externref) |
| ;; RTRIP-NEXT: (publish |
| ;; RTRIP-NEXT: (local.get $x) |
| ;; RTRIP-NEXT: ) |
| ;; RTRIP-NEXT: ) |
| (func $publish-extern (param $x externref) (result externref) |
| (publish |
| (local.get $x) |
| ) |
| ) |
| |
| ;; CHECK: (func $publish-func (type $12) (param $x funcref) (result funcref) |
| ;; CHECK-NEXT: (publish |
| ;; CHECK-NEXT: (local.get $x) |
| ;; CHECK-NEXT: ) |
| ;; CHECK-NEXT: ) |
| ;; RTRIP: (func $publish-func (type $12) (param $x funcref) (result funcref) |
| ;; RTRIP-NEXT: (publish |
| ;; RTRIP-NEXT: (local.get $x) |
| ;; RTRIP-NEXT: ) |
| ;; RTRIP-NEXT: ) |
| (func $publish-func (param $x funcref) (result funcref) |
| (publish |
| (local.get $x) |
| ) |
| ) |
| |
| ;; CHECK: (func $publish-null (type $13) (param $x nullref) (result nullref) |
| ;; CHECK-NEXT: (publish |
| ;; CHECK-NEXT: (local.get $x) |
| ;; CHECK-NEXT: ) |
| ;; CHECK-NEXT: ) |
| ;; RTRIP: (func $publish-null (type $13) (param $x nullref) (result nullref) |
| ;; RTRIP-NEXT: (publish |
| ;; RTRIP-NEXT: (local.get $x) |
| ;; RTRIP-NEXT: ) |
| ;; RTRIP-NEXT: ) |
| (func $publish-null (param $x nullref) (result nullref) |
| (publish |
| (local.get $x) |
| ) |
| ) |
| |
| ;; CHECK: (func $publish-flat (type $14) (param $x (ref any)) (result (ref any)) |
| ;; CHECK-NEXT: (publish |
| ;; CHECK-NEXT: (local.get $x) |
| ;; CHECK-NEXT: ) |
| ;; CHECK-NEXT: ) |
| ;; RTRIP: (func $publish-flat (type $14) (param $x (ref any)) (result (ref any)) |
| ;; RTRIP-NEXT: (publish |
| ;; RTRIP-NEXT: (local.get $x) |
| ;; RTRIP-NEXT: ) |
| ;; RTRIP-NEXT: ) |
| (func $publish-flat (param $x (ref any)) (result (ref any)) |
| (local.get $x) |
| (publish) |
| ) |
| |
| ;; CHECK: (func $publish-unreachable (type $15) (result (ref any)) |
| ;; CHECK-NEXT: (publish |
| ;; CHECK-NEXT: (unreachable) |
| ;; CHECK-NEXT: ) |
| ;; CHECK-NEXT: ) |
| ;; RTRIP: (func $publish-unreachable (type $15) (result (ref any)) |
| ;; RTRIP-NEXT: (unreachable) |
| ;; RTRIP-NEXT: ) |
| (func $publish-unreachable (result (ref any)) |
| (unreachable) |
| (publish) |
| ) |
| ) |