| ;; NOTE: Assertions have been generated by update_lit_checks.py and should not be edited. |
| |
| ;; RUN: wasm-opt %s -all --optimize-instructions -S -o - | filecheck %s |
| |
| (module |
| ;; CHECK: (type $shared (shared (struct (field (mut i32))))) |
| (type $shared (shared (struct (field (mut i32))))) |
| |
| ;; CHECK: (func $select-struct-wait (type $1) (param $x (ref $shared)) (param $wq (ref (shared waitqueue))) (result i32) |
| ;; CHECK-NEXT: (select |
| ;; CHECK-NEXT: (struct.wait $shared 0 |
| ;; CHECK-NEXT: (local.get $x) |
| ;; CHECK-NEXT: (local.get $wq) |
| ;; CHECK-NEXT: (i32.const 0) |
| ;; CHECK-NEXT: (i64.const -1) |
| ;; CHECK-NEXT: ) |
| ;; CHECK-NEXT: (struct.wait $shared 0 |
| ;; CHECK-NEXT: (local.get $x) |
| ;; CHECK-NEXT: (local.get $wq) |
| ;; CHECK-NEXT: (i32.const 0) |
| ;; CHECK-NEXT: (i64.const -1) |
| ;; CHECK-NEXT: ) |
| ;; CHECK-NEXT: (i32.const 1) |
| ;; CHECK-NEXT: ) |
| ;; CHECK-NEXT: ) |
| (func $select-struct-wait (param $x (ref $shared)) (param $wq (ref (shared waitqueue))) (result i32) |
| (select |
| (struct.wait $shared 0 |
| (local.get $x) |
| (local.get $wq) |
| (i32.const 0) |
| (i64.const -1) |
| ) |
| (struct.wait $shared 0 |
| (local.get $x) |
| (local.get $wq) |
| (i32.const 0) |
| (i64.const -1) |
| ) |
| (i32.const 1) |
| ) |
| ) |
| |
| ;; CHECK: (func $select-waitqueue-notify (type $2) (param $wq (ref (shared waitqueue))) (result i32) |
| ;; CHECK-NEXT: (select |
| ;; CHECK-NEXT: (waitqueue.notify |
| ;; CHECK-NEXT: (local.get $wq) |
| ;; CHECK-NEXT: (i32.const 1) |
| ;; CHECK-NEXT: ) |
| ;; CHECK-NEXT: (waitqueue.notify |
| ;; CHECK-NEXT: (local.get $wq) |
| ;; CHECK-NEXT: (i32.const 1) |
| ;; CHECK-NEXT: ) |
| ;; CHECK-NEXT: (i32.const 1) |
| ;; CHECK-NEXT: ) |
| ;; CHECK-NEXT: ) |
| (func $select-waitqueue-notify (param $wq (ref (shared waitqueue))) (result i32) |
| (select |
| (waitqueue.notify |
| (local.get $wq) |
| (i32.const 1) |
| ) |
| (waitqueue.notify |
| (local.get $wq) |
| (i32.const 1) |
| ) |
| (i32.const 1) |
| ) |
| ) |
| ) |