Skip to content

Commit 610b7aa

Browse files
authored
wasmprinter: print function bodies with code section (#1788)
* wasmprinter: print function bodies with code section * Re-bless more tests
1 parent fb403c3 commit 610b7aa

2,587 files changed

Lines changed: 15301 additions & 15316 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

crates/wasm-compose/tests/compositions/complex/composed.wat

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -81,16 +81,16 @@
8181
(type (;1;) (func (param i32 i32) (result i32)))
8282
(type (;2;) (func (param i32 i32 i32 i32) (result i32)))
8383
(import "a" "m" (func (;0;) (type 0)))
84+
(memory (;0;) 0)
85+
(export "memory" (memory 0))
86+
(export "m" (func $m))
87+
(export "canonical_abi_realloc" (func $canonical_abi_realloc))
8488
(func $m (;1;) (type 1) (param i32 i32) (result i32)
8589
unreachable
8690
)
8791
(func $canonical_abi_realloc (;2;) (type 2) (param i32 i32 i32 i32) (result i32)
8892
unreachable
8993
)
90-
(memory (;0;) 0)
91-
(export "memory" (memory 0))
92-
(export "m" (func $m))
93-
(export "canonical_abi_realloc" (func $canonical_abi_realloc))
9494
)
9595
(core module $m1 (;1;)
9696
(type (;0;) (func (param i32 i32)))
@@ -99,6 +99,15 @@
9999
(type (;3;) (func (param i32 i32 i32 i32 i32 i32 i32 i64 i64 f32 f64 i32 i32 i32)))
100100
(type (;4;) (func (param i32 i32 i64 i32 i32 i32 i32 i32 i64 i64 f32 f64 i32 i32 i32)))
101101
(type (;5;) (func (param i32)))
102+
(table (;0;) 7 7 funcref)
103+
(export "0" (func 0))
104+
(export "1" (func 1))
105+
(export "2" (func 2))
106+
(export "3" (func 3))
107+
(export "4" (func 4))
108+
(export "5" (func 5))
109+
(export "6" (func 6))
110+
(export "$imports" (table 0))
102111
(func (;0;) (type 0) (param i32 i32)
103112
local.get 0
104113
local.get 1
@@ -189,15 +198,6 @@
189198
i32.const 6
190199
call_indirect (type 5)
191200
)
192-
(table (;0;) 7 7 funcref)
193-
(export "0" (func 0))
194-
(export "1" (func 1))
195-
(export "2" (func 2))
196-
(export "3" (func 3))
197-
(export "4" (func 4))
198-
(export "5" (func 5))
199-
(export "6" (func 6))
200-
(export "$imports" (table 0))
201201
)
202202
(core module $m2 (;2;)
203203
(type (;0;) (func (param i32 i32)))
@@ -366,6 +366,30 @@
366366
(type (;9;) (func (param i32 i32 i64 i32 i32 i32 i32 i32 i64 i64 f32 f64 i32 i32 i32)))
367367
(type (;10;) (func (result i32)))
368368
(type (;11;) (func (param i32 i32 i32 i32) (result i32)))
369+
(memory (;0;) 0)
370+
(export "memory" (memory 0))
371+
(export "a" (func $a))
372+
(export "b" (func $b))
373+
(export "c" (func $c))
374+
(export "d" (func $d))
375+
(export "e" (func $e))
376+
(export "f" (func $f))
377+
(export "g" (func $g))
378+
(export "h" (func $h))
379+
(export "i" (func $i))
380+
(export "j" (func $j))
381+
(export "k" (func $k))
382+
(export "l" (func $l))
383+
(export "m" (func $m))
384+
(export "n" (func $n))
385+
(export "o" (func $o))
386+
(export "p" (func $p))
387+
(export "q" (func $q))
388+
(export "r" (func $r))
389+
(export "s" (func $s))
390+
(export "t" (func $t))
391+
(export "u" (func $u))
392+
(export "canonical_abi_realloc" (func $canonical_abi_realloc))
369393
(func $a (;0;) (type 0)
370394
unreachable
371395
)
@@ -432,30 +456,6 @@
432456
(func $canonical_abi_realloc (;21;) (type 11) (param i32 i32 i32 i32) (result i32)
433457
unreachable
434458
)
435-
(memory (;0;) 0)
436-
(export "memory" (memory 0))
437-
(export "a" (func $a))
438-
(export "b" (func $b))
439-
(export "c" (func $c))
440-
(export "d" (func $d))
441-
(export "e" (func $e))
442-
(export "f" (func $f))
443-
(export "g" (func $g))
444-
(export "h" (func $h))
445-
(export "i" (func $i))
446-
(export "j" (func $j))
447-
(export "k" (func $k))
448-
(export "l" (func $l))
449-
(export "m" (func $m))
450-
(export "n" (func $n))
451-
(export "o" (func $o))
452-
(export "p" (func $p))
453-
(export "q" (func $q))
454-
(export "r" (func $r))
455-
(export "s" (func $s))
456-
(export "t" (func $t))
457-
(export "u" (func $u))
458-
(export "canonical_abi_realloc" (func $canonical_abi_realloc))
459459
)
460460
(core instance (;0;) (instantiate 0))
461461
(alias core export 0 "memory" (core memory (;0;)))

crates/wasm-compose/tests/compositions/connect-resources/composed.wat

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@
4646
(import "example:service/logging@0.1.0" "[method]logger.log" (func (;0;) (type 0)))
4747
(import "example:service/logging@0.1.0" "get-logger" (func (;1;) (type 1)))
4848
(import "[export]example:service/logging@0.1.0" "[resource-new]logger" (func (;2;) (type 2)))
49+
(memory $memory (;0;) 1)
50+
(export "memory" (memory $memory))
51+
(export "cabi_realloc" (func $cabi_realloc))
52+
(export "example:service/logging@0.1.0#[method]logger.log" (func $logger-log))
53+
(export "example:service/logging@0.1.0#get-logger" (func $get-logger))
4954
(func $cabi_realloc (;3;) (type 3) (param i32 i32 i32 i32) (result i32)
5055
unreachable
5156
)
@@ -55,16 +60,13 @@
5560
(func $get-logger (;5;) (type 1) (result i32)
5661
unreachable
5762
)
58-
(memory $memory (;0;) 1)
59-
(export "memory" (memory $memory))
60-
(export "cabi_realloc" (func $cabi_realloc))
61-
(export "example:service/logging@0.1.0#[method]logger.log" (func $logger-log))
62-
(export "example:service/logging@0.1.0#get-logger" (func $get-logger))
6363
)
6464
(core module $module-indirect (;1;)
6565
(type (;0;) (func (param i32 i32 i32)))
6666
(type (;1;) (func (result i32)))
6767
(type (;2;) (func (param i32)))
68+
(export "logger.log" (func $logger-log))
69+
(export "[dtor]logger" (func $dtor-logger))
6870
(func $logger-log (;0;) (type 0) (param i32 i32 i32)
6971
unreachable
7072
)
@@ -74,8 +76,6 @@
7476
(func $dtor-logger (;2;) (type 2) (param i32)
7577
unreachable
7678
)
77-
(export "logger.log" (func $logger-log))
78-
(export "[dtor]logger" (func $dtor-logger))
7979
)
8080
(core instance $module-indirect-instance (;0;) (instantiate $module-indirect))
8181
(alias export $import-logging-instance "logger" (type $import-logger-type (;1;)))

crates/wasm-compose/tests/compositions/defs/composed.wat

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,22 @@
2525
(type (;1;) (func (param i32 i32 i32 i32) (result i32)))
2626
(import "wasi:cli-base/environment" "get-environment" (func (;0;) (type 0)))
2727
(import "wasi:cli-base/environment" "get-arguments" (func (;1;) (type 0)))
28-
(func (;2;) (type 1) (param i32 i32 i32 i32) (result i32)
29-
unreachable
30-
)
3128
(memory (;0;) 0)
3229
(export "memory" (memory 0))
3330
(export "cabi_realloc" (func 2))
31+
(func (;2;) (type 1) (param i32 i32 i32 i32) (result i32)
32+
unreachable
33+
)
3434
(@producers
3535
(processed-by "wit-component" "0.11.0")
3636
)
3737
)
3838
(core module (;1;)
3939
(type (;0;) (func (param i32)))
40+
(table (;0;) 2 2 funcref)
41+
(export "0" (func $indirect-wasi:cli-base/environment-get-environment))
42+
(export "1" (func $indirect-wasi:cli-base/environment-get-arguments))
43+
(export "$imports" (table 0))
4044
(func $indirect-wasi:cli-base/environment-get-environment (;0;) (type 0) (param i32)
4145
local.get 0
4246
i32.const 0
@@ -47,10 +51,6 @@
4751
i32.const 1
4852
call_indirect (type 0)
4953
)
50-
(table (;0;) 2 2 funcref)
51-
(export "0" (func $indirect-wasi:cli-base/environment-get-environment))
52-
(export "1" (func $indirect-wasi:cli-base/environment-get-arguments))
53-
(export "$imports" (table 0))
5454
(@producers
5555
(processed-by "wit-component" "0.11.0")
5656
)
@@ -107,6 +107,15 @@
107107
(type (;6;) (func (param i32) (result i32)))
108108
(type (;7;) (func (param i32 i32)))
109109
(type (;8;) (func (param i32 i32 i32) (result i32)))
110+
(table (;0;) 1 1 funcref)
111+
(memory (;0;) 17)
112+
(global $__stack_pointer (;0;) (mut i32) i32.const 1048576)
113+
(export "memory" (memory 0))
114+
(export "wasi:cli-base/environment#get-environment" (func $wasi:cli-base/environment#get-environment))
115+
(export "cabi_post_wasi:cli-base/environment#get-environment" (func $cabi_post_wasi:cli-base/environment#get-environment))
116+
(export "wasi:cli-base/environment#get-arguments" (func $wasi:cli-base/environment#get-arguments))
117+
(export "cabi_post_wasi:cli-base/environment#get-arguments" (func $cabi_post_wasi:cli-base/environment#get-arguments))
118+
(export "cabi_realloc" (func $cabi_realloc))
110119
(func $__wasm_call_ctors (;0;) (type 0))
111120
(func $wasi:cli-base/environment#get-environment (;1;) (type 1) (result i32)
112121
i32.const 0
@@ -119,15 +128,6 @@
119128
(func $cabi_realloc (;5;) (type 5) (param i32 i32 i32 i32) (result i32)
120129
i32.const 0
121130
)
122-
(table (;0;) 1 1 funcref)
123-
(memory (;0;) 17)
124-
(global $__stack_pointer (;0;) (mut i32) i32.const 1048576)
125-
(export "memory" (memory 0))
126-
(export "wasi:cli-base/environment#get-environment" (func $wasi:cli-base/environment#get-environment))
127-
(export "cabi_post_wasi:cli-base/environment#get-environment" (func $cabi_post_wasi:cli-base/environment#get-environment))
128-
(export "wasi:cli-base/environment#get-arguments" (func $wasi:cli-base/environment#get-arguments))
129-
(export "cabi_post_wasi:cli-base/environment#get-arguments" (func $cabi_post_wasi:cli-base/environment#get-arguments))
130-
(export "cabi_realloc" (func $cabi_realloc))
131131
)
132132
(core instance (;0;) (instantiate 0))
133133
(alias core export 0 "memory" (core memory (;0;)))

0 commit comments

Comments
 (0)