|
1 | 1 | (module
|
2 |
| - (func $empty) |
3 |
| - (export "empty" $empty) |
| 2 | + (func "empty") |
4 | 3 |
|
5 |
| - (func $result-nop (nop)) |
6 |
| - (export "result-nop" $result-nop) |
| 4 | + (func "value-nop" (nop)) |
| 5 | + (func "value-drop" (i32.const 1)) |
| 6 | + (func "value-block-nop" (block (i32.const 1) (nop))) |
| 7 | + (func "value-block-drop" (block (nop) (i32.const 1))) |
7 | 8 |
|
8 |
| - (func $result-drop (i32.const 1)) |
9 |
| - (export "result-drop" $result-drop) |
| 9 | + (func "return" (return)) |
| 10 | + (func "return-nop" (return (nop))) |
| 11 | + (func "return-drop" (return (i32.const 1))) |
| 12 | + (func "return-block-nop" (return (block (i32.const 1) (nop)))) |
| 13 | + (func "return-block-drop" (return (block (nop) (i32.const 1)))) |
10 | 14 |
|
11 |
| - (func $result-block-nop (block (i32.const 1) (nop))) |
12 |
| - (export "result-block-nop" $result-block-nop) |
| 15 | + (func "param" (param i32) (i32.eqz (get_local 0))) |
| 16 | + (func "params" (param i32 f64) |
| 17 | + (i32.eqz (get_local 0)) (f64.neg (get_local 1)) |
| 18 | + ) |
| 19 | + (func "param-param" (param i32) (param f64) |
| 20 | + (i32.eqz (get_local 0)) (f64.neg (get_local 1)) |
| 21 | + ) |
| 22 | + (func "params-params" (param i32 f32) (param i32) (param f64 i64) |
| 23 | + (i32.eqz (get_local 0)) (f32.neg (get_local 1)) (i32.eqz (get_local 2)) |
| 24 | + (f64.neg (get_local 3)) (i64.eqz (get_local 4)) |
| 25 | + ) |
13 | 26 |
|
14 |
| - (func $result-block-drop (block (nop) (i32.const 1))) |
15 |
| - (export "result-block-drop" $result-block-drop) |
| 27 | + (func "result" (result i32) (i32.const 1)) |
16 | 28 |
|
17 |
| - (func $return (return)) |
18 |
| - (export "return" $return) |
| 29 | + (func "local" (local i32) (i32.eqz (get_local 0))) |
| 30 | + (func "locals" (local i32 f64 i64) |
| 31 | + (i32.eqz (get_local 0)) (f64.neg (get_local 1)) (i64.eqz (get_local 2)) |
| 32 | + ) |
| 33 | + (func "local-local" (local i32) (local f64) |
| 34 | + (i32.eqz (get_local 0)) (f64.neg (get_local 1)) |
| 35 | + ) |
| 36 | + (func "locals-locals" (local i32 f32) (local i32) (local f64 i64) |
| 37 | + (i32.eqz (get_local 0)) (f32.neg (get_local 1)) (i32.eqz (get_local 2)) |
| 38 | + (f64.neg (get_local 3)) (i64.eqz (get_local 4)) |
| 39 | + ) |
19 | 40 |
|
20 |
| - (func $return-nop (return (nop))) |
21 |
| - (export "return-nop" $return-nop) |
| 41 | + (func "param-result" (param i32) (result i32) (i32.eqz (get_local 0))) |
| 42 | + (func "params-result" (param i32 f64) (result i32) |
| 43 | + (f64.neg (get_local 1)) (i32.eqz (get_local 0)) |
| 44 | + ) |
| 45 | + (func "param-param-result" (param i32) (param f64) (result i32) |
| 46 | + (f64.neg (get_local 1)) (i32.eqz (get_local 0)) |
| 47 | + ) |
22 | 48 |
|
23 |
| - (func $return-drop (return (i32.const 1))) |
24 |
| - (export "return-drop" $return-drop) |
| 49 | + (func "result-local" (result i32) (local i32) (i32.eqz (get_local 0))) |
| 50 | + (func "result-locals" (result i32) (local i32 f64) |
| 51 | + (f64.neg (get_local 1)) (i32.eqz (get_local 0)) |
| 52 | + ) |
| 53 | + (func "result-local-local" (result i32) (local i32) (local f64) |
| 54 | + (f64.neg (get_local 1)) (i32.eqz (get_local 0)) |
| 55 | + ) |
25 | 56 |
|
26 |
| - (func $return-block-nop (return (block (i32.const 1) (nop)))) |
27 |
| - (export "return-block-nop" $return-block-nop) |
| 57 | + (func "param-local" (param i32) (local f64) |
| 58 | + (i32.eqz (get_local 0)) (f64.neg (get_local 1)) |
| 59 | + ) |
| 60 | + (func "params-local" (param i32 i64) (local f64) |
| 61 | + (i32.eqz (get_local 0)) (i64.eqz (get_local 1)) (f64.neg (get_local 2)) |
| 62 | + ) |
| 63 | + (func "param-locals" (param i32) (local i64 f64) |
| 64 | + (i32.eqz (get_local 0)) (i64.eqz (get_local 1)) (f64.neg (get_local 2)) |
| 65 | + ) |
| 66 | + (func "params-locals" (param f32 i32) (local i64 f64) |
| 67 | + (f32.neg (get_local 0)) (i32.eqz (get_local 1)) |
| 68 | + (i64.eqz (get_local 2)) (f64.neg (get_local 3)) |
| 69 | + ) |
| 70 | + (func "param-params-locals-local" (param f32) (param i32 f32) (local i64 f64) (local i32) |
| 71 | + (f32.neg (get_local 0)) (i32.eqz (get_local 1)) (f32.neg (get_local 2)) |
| 72 | + (i64.eqz (get_local 3)) (f64.neg (get_local 4)) (i32.eqz (get_local 5)) |
| 73 | + ) |
28 | 74 |
|
29 |
| - (func $return-block-drop (return (block (nop) (i32.const 1)))) |
30 |
| - (export "return-block-drop" $return-block-drop) |
| 75 | + (func "param-result-local" (param i32) (result f64) (local f64) |
| 76 | + (i32.eqz (get_local 0)) (f64.neg (get_local 1)) |
| 77 | + ) |
| 78 | + (func "params-params-result-locals-locals" |
| 79 | + (param i32 i64) (param f32 f64) (result i32) |
| 80 | + (local i32 f64) (local i64 f32 i32) |
| 81 | + (i32.eqz (get_local 0)) (i64.eqz (get_local 1)) (f32.neg (get_local 2)) |
| 82 | + (f64.neg (get_local 3)) (i32.eqz (get_local 4)) (f64.neg (get_local 5)) |
| 83 | + (i64.eqz (get_local 6)) (f32.neg (get_local 7)) (i32.eqz (get_local 8)) |
| 84 | + ) |
31 | 85 | )
|
32 | 86 |
|
33 | 87 | (assert_return (invoke "empty"))
|
34 |
| -(assert_return (invoke "result-nop")) |
35 |
| -(assert_return (invoke "result-drop")) |
36 |
| -(assert_return (invoke "result-block-nop")) |
37 |
| -(assert_return (invoke "result-block-drop")) |
| 88 | + |
| 89 | +(assert_return (invoke "value-nop")) |
| 90 | +(assert_return (invoke "value-drop")) |
| 91 | +(assert_return (invoke "value-block-nop")) |
| 92 | +(assert_return (invoke "value-block-drop")) |
38 | 93 |
|
39 | 94 | (assert_return (invoke "return"))
|
40 | 95 | (assert_return (invoke "return-nop"))
|
41 | 96 | (assert_return (invoke "return-drop"))
|
42 | 97 | (assert_return (invoke "return-block-nop"))
|
43 | 98 | (assert_return (invoke "return-block-drop"))
|
44 | 99 |
|
| 100 | +(assert_return (invoke "param" (i32.const 1))) |
| 101 | +(assert_return (invoke "params" (i32.const 1) (f64.const 0))) |
| 102 | +(assert_return (invoke "param-param" (i32.const 1) (f64.const 0))) |
| 103 | +(assert_return (invoke "params-params" (i32.const 1) (f32.const 0) (i32.const 1) (f64.const 0) (i64.const 1))) |
| 104 | + |
| 105 | +(assert_return (invoke "result") (i32.const 1)) |
| 106 | + |
| 107 | +(assert_return (invoke "local")) |
| 108 | +(assert_return (invoke "locals")) |
| 109 | +(assert_return (invoke "local-local")) |
| 110 | +(assert_return (invoke "locals-locals")) |
| 111 | + |
| 112 | +(assert_return (invoke "param-result" (i32.const 1)) (i32.const 0)) |
| 113 | +(assert_return (invoke "params-result" (i32.const 1) (f64.const 0)) (i32.const 0)) |
| 114 | +(assert_return (invoke "param-param-result" (i32.const 1) (f64.const 0)) (i32.const 0)) |
| 115 | + |
| 116 | +(assert_return (invoke "result-local") (i32.const 1)) |
| 117 | +(assert_return (invoke "result-locals" ) (i32.const 1)) |
| 118 | +(assert_return (invoke "result-local-local") (i32.const 1)) |
| 119 | + |
| 120 | +(assert_return (invoke "param-local" (i32.const 1))) |
| 121 | +(assert_return (invoke "params-local" (i32.const 1) (i64.const 0))) |
| 122 | +(assert_return (invoke "param-locals" (i32.const 1))) |
| 123 | +(assert_return (invoke "params-locals" (f32.const 1) (i32.const 0))) |
| 124 | +(assert_return (invoke "param-params-locals-local" (f32.const 1) (i32.const 0) (f32.const 1))) |
| 125 | + |
| 126 | +(assert_return (invoke "param-result-local" (i32.const 1)) (f64.const -0)) |
| 127 | +(assert_return (invoke "params-params-result-locals-locals" (i32.const 1) (i64.const 1) (f32.const 0) (f64.const 1)) (i32.const 1)) |
| 128 | + |
0 commit comments