| ;; NOTE: Assertions have been generated by update_lit_checks.py and should not be edited. |
| ;; RUN: wasm-opt %s -all --closed-world --unsubtyping -S -o - | filecheck %s |
| |
| (module |
| ;; CHECK: (rec |
| ;; CHECK-NEXT: (type $array-unshared (array (mut eqref))) |
| |
| ;; CHECK: (type $array-shared (shared (array (mut (ref null (shared eq)))))) |
| |
| ;; CHECK: (type $struct-unshared (struct (field (mut eqref)))) |
| |
| ;; CHECK: (type $struct-shared (struct (field (mut (ref null (shared eq)))))) |
| (type $struct-shared (struct (field (mut (ref null (shared eq)))))) |
| (type $struct-unshared (struct (field (mut eqref)))) |
| |
| (type $array-shared (shared (array (mut (ref null (shared eq)))))) |
| (type $array-unshared (array (mut eqref))) |
| |
| ;; CHECK: (func $struct-shared-eq (type $7) (param $struct (ref $struct-shared)) (param $eq (ref null (shared eq))) (result (ref null (shared eq))) |
| ;; CHECK-NEXT: (struct.atomic.rmw.cmpxchg $struct-shared 0 |
| ;; CHECK-NEXT: (local.get $struct) |
| ;; CHECK-NEXT: (local.get $eq) |
| ;; CHECK-NEXT: (local.get $eq) |
| ;; CHECK-NEXT: ) |
| ;; CHECK-NEXT: ) |
| (func $struct-shared-eq (param $struct (ref $struct-shared)) (param $eq (ref null (shared eq))) (result (ref null (shared eq))) |
| (struct.atomic.rmw.cmpxchg $struct-shared 0 |
| (local.get $struct) |
| (local.get $eq) |
| (local.get $eq) |
| ) |
| ) |
| |
| ;; CHECK: (func $struct-unshared-eq (type $6) (param $struct (ref $struct-unshared)) (param $eq eqref) (result eqref) |
| ;; CHECK-NEXT: (struct.atomic.rmw.cmpxchg $struct-unshared 0 |
| ;; CHECK-NEXT: (local.get $struct) |
| ;; CHECK-NEXT: (local.get $eq) |
| ;; CHECK-NEXT: (local.get $eq) |
| ;; CHECK-NEXT: ) |
| ;; CHECK-NEXT: ) |
| (func $struct-unshared-eq (param $struct (ref $struct-unshared)) (param $eq eqref) (result eqref) |
| (struct.atomic.rmw.cmpxchg $struct-unshared 0 |
| (local.get $struct) |
| (local.get $eq) |
| (local.get $eq) |
| ) |
| ) |
| |
| ;; CHECK: (func $array-shared-eq (type $5) (param $array (ref $array-shared)) (param $eq (ref null (shared eq))) (result (ref null (shared eq))) |
| ;; CHECK-NEXT: (array.atomic.rmw.cmpxchg $array-shared |
| ;; CHECK-NEXT: (local.get $array) |
| ;; CHECK-NEXT: (i32.const 0) |
| ;; CHECK-NEXT: (local.get $eq) |
| ;; CHECK-NEXT: (local.get $eq) |
| ;; CHECK-NEXT: ) |
| ;; CHECK-NEXT: ) |
| (func $array-shared-eq (param $array (ref $array-shared)) (param $eq (ref null (shared eq))) (result (ref null (shared eq))) |
| (array.atomic.rmw.cmpxchg $array-shared |
| (local.get $array) |
| (i32.const 0) |
| (local.get $eq) |
| (local.get $eq) |
| ) |
| ) |
| |
| ;; CHECK: (func $array-unshared-eq (type $4) (param $array (ref $array-unshared)) (param $eq eqref) (result eqref) |
| ;; CHECK-NEXT: (array.atomic.rmw.cmpxchg $array-unshared |
| ;; CHECK-NEXT: (local.get $array) |
| ;; CHECK-NEXT: (i32.const 0) |
| ;; CHECK-NEXT: (local.get $eq) |
| ;; CHECK-NEXT: (local.get $eq) |
| ;; CHECK-NEXT: ) |
| ;; CHECK-NEXT: ) |
| (func $array-unshared-eq (param $array (ref $array-unshared)) (param $eq eqref) (result eqref) |
| (array.atomic.rmw.cmpxchg $array-unshared |
| (local.get $array) |
| (i32.const 0) |
| (local.get $eq) |
| (local.get $eq) |
| ) |
| ) |
| ) |