Debian Codegraph @

tests/cli/if-else-parsing.wast

raw
1 ;; RUN: wast --assert default --snapshot tests/snapshots %
2
3 (module
4 (func $a1
5 i32.const 0
6 (if (then) (else))
7 )
8 (func $a2
9 (if (i32.const 1) (i32.eqz) (then) (else))
10 )
11 (func $a3
12 (if (i32.const 1) (i32.eqz) (then))
13 )
14 (func $a4
15 (if (i32.const 1) (i32.eqz) (then nop))
16 )
17 )
18 (assert_malformed
19 (module quote
20 "(func (if))"
21 )
22 "no `then`")
23
24 (assert_malformed
25 (module quote
26 "(func (if (else)))"
27 )
28 "no `then`")
29
30 (assert_malformed
31 (module quote
32 "(func (if nop (else)))"
33 )
34 "expected `(`")
35 (assert_malformed
36 (module quote
37 "(func (if (nop) (else)))"
38 )
39 "no `then`")
40 (assert_malformed
41 (module quote
42 "(func (if (nop) nop (then)))"
43 )
44 "expected `(`")