| 1 |
;; RUN: wast --assert default --snapshot tests/snapshots % |
| 2 |
|
| 3 |
(component |
| 4 |
(type $Wasi (instance)) |
| 5 |
(component $B) |
| 6 |
(component $B_wrap |
| 7 |
(import "wasi" (instance $wasi (type $Wasi))) |
| 8 |
(instance $b (instantiate $B)) |
| 9 |
) |
| 10 |
) |
| 11 |
|
| 12 |
(component |
| 13 |
(type $Wasi (instance)) |
| 14 |
(import "wasi" (instance $wasi (type $Wasi))) |
| 15 |
|
| 16 |
(component $A |
| 17 |
(type $Wasi (instance)) |
| 18 |
(import "wasi" (instance (type $Wasi))) |
| 19 |
|
| 20 |
(core module $m |
| 21 |
(func (export "a")) |
| 22 |
) |
| 23 |
|
| 24 |
(core instance $i (instantiate $m)) |
| 25 |
(func (export "a") |
| 26 |
(canon lift (core func $i "a")) |
| 27 |
) |
| 28 |
) |
| 29 |
|
| 30 |
(component $B |
| 31 |
(type $Wasi (instance)) |
| 32 |
(import "wasi" (instance $wasi (type $Wasi))) |
| 33 |
(import "a1-x" (component $A |
| 34 |
(import "wasi" (instance (type $Wasi))) |
| 35 |
(export "a" (func)) |
| 36 |
)) |
| 37 |
(instance $a (instantiate $A (with "wasi" (instance $wasi)))) |
| 38 |
|
| 39 |
(core func $lower (canon lower (func $a "a"))) |
| 40 |
(core module $b |
| 41 |
(import "a" "a" (func)) |
| 42 |
(func (export "b")) |
| 43 |
) |
| 44 |
(core instance $b (instantiate $b |
| 45 |
(with "a" (instance (export "a" (func $lower)))) |
| 46 |
)) |
| 47 |
(func (export "b") |
| 48 |
(canon lift (core func $b "b")) |
| 49 |
) |
| 50 |
) |
| 51 |
(component $B_wrap |
| 52 |
(type $Wasi (instance)) |
| 53 |
(import "wasi" (instance $wasi (type $Wasi))) |
| 54 |
(instance $b (instantiate $B |
| 55 |
(with "wasi" (instance $wasi)) |
| 56 |
(with "a1-x" (component $A))) |
| 57 |
) |
| 58 |
(export "b" (func $b "b")) |
| 59 |
) |
| 60 |
|
| 61 |
(component $C |
| 62 |
(type $Wasi (instance)) |
| 63 |
(import "wasi" (instance $wasi (type $Wasi))) |
| 64 |
(import "b1-x" (component $B |
| 65 |
(import "wasi" (instance $wasi (type $Wasi))) |
| 66 |
(export "b" (func)) |
| 67 |
)) |
| 68 |
(instance $b (instantiate $B (with "wasi" (instance $wasi)))) |
| 69 |
(export "c" (func $b "b")) |
| 70 |
) |
| 71 |
(component $C_wrap |
| 72 |
(type $Wasi (instance)) |
| 73 |
(import "wasi" (instance $wasi (type $Wasi))) |
| 74 |
(instance $c (instantiate $C |
| 75 |
(with "wasi" (instance $wasi)) |
| 76 |
(with "b1-x" (component $B_wrap)) |
| 77 |
)) |
| 78 |
(export "c" (func $c "c")) |
| 79 |
) |
| 80 |
|
| 81 |
(component $D |
| 82 |
(type $Wasi (instance)) |
| 83 |
(import "wasi" (instance $wasi (type $Wasi))) |
| 84 |
(import "c1-x" (component $C |
| 85 |
(import "wasi" (instance $wasi (type $Wasi))) |
| 86 |
(export "c" (func)) |
| 87 |
)) |
| 88 |
(instance $c (instantiate $C (with "wasi" (instance $wasi)))) |
| 89 |
(export "d" (func $c "c")) |
| 90 |
) |
| 91 |
|
| 92 |
(instance $d (instantiate $D |
| 93 |
(with "wasi" (instance $wasi)) |
| 94 |
(with "c1-x" (component $C_wrap)) |
| 95 |
)) |
| 96 |
|
| 97 |
(export "d" (func $d "d")) |
| 98 |
) |