summaryrefslogtreecommitdiff
path: root/test/passes/asyncify_mod-asyncify-never-unwind_O.txt
blob: 18f55e79ef41bb4b6efbfa05ec91792a728e8a79 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
(module
 (type $none_=>_none (func))
 (type $i32_=>_none (func (param i32)))
 (type $none_=>_i32 (func (result i32)))
 (import "env" "import" (func $import))
 (global $__asyncify_state (mut i32) (i32.const 0))
 (global $__asyncify_data (mut i32) (i32.const 0))
 (memory $0 1 2)
 (export "calls-import" (func $calls-import))
 (export "calls-import2" (func $calls-import))
 (export "calls-import2-drop" (func $calls-import))
 (export "calls-nothing" (func $calls-import))
 (export "asyncify_start_unwind" (func $asyncify_start_unwind))
 (export "asyncify_stop_unwind" (func $asyncify_stop_unwind))
 (export "asyncify_start_rewind" (func $asyncify_start_rewind))
 (export "asyncify_stop_rewind" (func $asyncify_stop_unwind))
 (export "asyncify_get_state" (func $asyncify_get_state))
 (func $calls-import (; has Stack IR ;)
  (if
   (i32.eqz
    (select
     (if (result i32)
      (i32.eq
       (global.get $__asyncify_state)
       (i32.const 2)
      )
      (block (result i32)
       (i32.store
        (global.get $__asyncify_data)
        (i32.sub
         (i32.load
          (global.get $__asyncify_data)
         )
         (i32.const 4)
        )
       )
       (i32.load
        (i32.load
         (global.get $__asyncify_data)
        )
       )
      )
      (i32.const 0)
     )
     (i32.const 0)
     (global.get $__asyncify_state)
    )
   )
   (call $import)
  )
 )
 (func $asyncify_start_unwind (; has Stack IR ;) (param $0 i32)
  (global.set $__asyncify_state
   (i32.const 1)
  )
  (global.set $__asyncify_data
   (local.get $0)
  )
  (if
   (i32.gt_u
    (i32.load
     (global.get $__asyncify_data)
    )
    (i32.load offset=4
     (global.get $__asyncify_data)
    )
   )
   (unreachable)
  )
 )
 (func $asyncify_stop_unwind (; has Stack IR ;)
  (global.set $__asyncify_state
   (i32.const 0)
  )
  (if
   (i32.gt_u
    (i32.load
     (global.get $__asyncify_data)
    )
    (i32.load offset=4
     (global.get $__asyncify_data)
    )
   )
   (unreachable)
  )
 )
 (func $asyncify_start_rewind (; has Stack IR ;) (param $0 i32)
  (global.set $__asyncify_state
   (i32.const 2)
  )
  (global.set $__asyncify_data
   (local.get $0)
  )
  (if
   (i32.gt_u
    (i32.load
     (global.get $__asyncify_data)
    )
    (i32.load offset=4
     (global.get $__asyncify_data)
    )
   )
   (unreachable)
  )
 )
 (func $asyncify_get_state (; has Stack IR ;) (result i32)
  (global.get $__asyncify_state)
 )
)