Debian Codegraph @

crates/wit-component/tests/components/deduplicate-imports/module.wat

raw
1 (module
2 ;; Import an adapter function twice.
3 (func $exit1 (import "wasi-snapshot-preview1" "proc_exit") (param i32))
4 (func $exit2 (import "wasi-snapshot-preview1" "proc_exit") (param i32))
5
6 ;; define `f2` before the second `f` import shows up
7 (import "cm32p2" "f" (func $f_v1))
8 (import "cm32p2" "f2" (func $f2 (result i32)))
9 (import "cm32p2" "f" (func $f_v2))
10 (import "cm32p2" "f" (func $f_v3))
11
12 ;; define two `g` imports before the "real" `g2` import shows up
13 (import "cm32p2" "g" (func $g_v1))
14 (import "cm32p2" "g" (func $g_v2))
15 (import "cm32p2" "g2" (func $g2 (result i32)))
16
17 (func
18 ;; Call all the "f" imports and its duplicate copies
19 call $f_v1
20 call $f_v2
21 call $f_v3
22 call $f2
23 drop
24
25 ;; Call all the "g" imports and its duplicate copies
26 call $g_v1
27 call $g_v2
28 call $g2
29 drop
30
31 ;; Call all the "proc_exit" imports and its duplicate copies
32 i32.const 42
33 call $exit1
34 i32.const 42
35 call $exit2
36 )
37
38 ;; Required by wasi
39 (memory (export "memory") 1)
40 )