message: test: linking exported-imported functions between two modules
diff: @@ -1156,6 +1156,47 @@ TEST(execute, imported_functions_call_indirect)
  EXPECT_RESULT(execute(instance, 3, {2, 50}), 7); // isqrt(50)
  }
  +TEST(execute, imported_function_from_another_module)
  +{
  + /* wat2wasm
  + (module
  + (func $sub (param $lhs i32) (param $rhs i32) (result i32)
  + get_local $lhs
  + get_local $rhs
  + i32.sub)
  + (export "sub" (func $sub))
  + )
  + */
  + static const auto bin1 = from_hex(
  + "0061736d0100000001070160027f7f017f030201000707010373756200000a09010700200020016b0b");
  + static const auto module1 = parse(bin1);
  + static auto instance1 = instantiate(module1);
  +
  + /* wat2wasm
  + (module
  + (func $sub (import "m1" "sub") (param $lhs i32) (param $rhs i32) (result i32))
  +
  + (func $main (param i32) (param i32) (result i32)
  + get_local 0
  + get_local 1
  + call $sub
  + )
  + )
  + */
  + const auto bin2 = from_hex(
  + "0061736d0100000001070160027f7f017f020a01026d31037375620000030201000a0a0108002000200110000"
  + "b");
  + const auto module2 = parse(bin2);
  +
  + auto sub = [](Instance&, std::vector<uint64_t> args) -> execution_result {
  + return fizzy::execute(instance1, 0, std::move(args));
  + };
  +
  + auto instance2 = instantiate(module2, {sub});
  +
  + EXPECT_RESULT(execute(instance2, 1, {44, 2}), 42);
  +}
  +
  TEST(execute, memory_copy_32bytes)
  {
  /* wat2wasm
  