tests/cli/component-model/link.wast
raw| 1 | ;; RUN: wast --assert default --snapshot tests/snapshots % |
| 2 | |
| 3 | ;; Based on this, we can link two modules $A and $B together with the following component: |
| 4 | |
| 5 | (component |
| 6 | (core module $A |
| 7 | (func (export "one") (result i32) (i32.const 1)) |
| 8 | ) |
| 9 | (core module $B |
| 10 | (func (import "a" "one") (result i32)) |
| 11 | ) |
| 12 | (core instance $a (instantiate $A)) |
| 13 | (core instance $b (instantiate $B (with "a" (instance $a)))) |
| 14 | ) |