### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
// Begin of Foo (from "<...>/yield.hlt")
// Compiled by HILTI version X.X.X

#include <hilti/rt/compiler-setup.h>

#include <hilti/rt/libhilti.h>

extern const char* __hlt_hlto_scope;

namespace __hlt::Foo {
    extern void __register_module();
    extern auto test(const std::string& x) -> std::string;
}

namespace hlt::Foo {
    extern auto test(const std::string& x) -> ::hilti::rt::Resumable;
}

HILTI_PRE_INIT(__hlt::Foo::__register_module)

extern void __hlt::Foo::__register_module() { ::hilti::rt::detail::registerModule({ "Foo", __hlt_hlto_scope, nullptr, nullptr, nullptr, nullptr}); }

extern auto __hlt::Foo::test(const std::string& x) -> std::string {
    ::hilti::rt::detail::checkStack();
      __location__("<...>/yield.hlt:12:5");
    ::hilti::rt::print(std::string("HILTI - 1 - argument: "), ::hilti::rt::Bool(false));
      __location__("<...>/yield.hlt:13:5");
    ::hilti::rt::print(x, ::hilti::rt::Bool(true));
      __location__("<...>/yield.hlt:15:5");
    ::hilti::rt::detail::yield();
      __location__("<...>/yield.hlt:16:5");
    ::hilti::rt::print(std::string("HILTI - 2"), ::hilti::rt::Bool(true));
      __location__("<...>/yield.hlt:17:5");
    ::hilti::rt::detail::yield();
      __location__("<...>/yield.hlt:18:5");
    ::hilti::rt::print(std::string("HILTI - 3"), ::hilti::rt::Bool(true));
      __location__("<...>/yield.hlt:19:5");
    ::hilti::rt::detail::yield();
      __location__("<...>/yield.hlt:20:5");
    ::hilti::rt::print(std::string("HILTI - Done"), ::hilti::rt::Bool(true));
      __location__("<...>/yield.hlt:22:5");
    return std::string("test-result");
}

extern auto hlt::Foo::test(const std::string& x) -> ::hilti::rt::Resumable {
    auto args = std::make_tuple(::hilti::rt::resumable::detail::copyArg(x));
    auto args_on_heap = std::make_shared<decltype(args)>(std::move(args));
    auto cb = [args_on_heap](hilti::rt::resumable::Handle* r) -> hilti::rt::any {
        return __hlt::Foo::test(std::get<0>(*args_on_heap));
    };

    auto r = std::make_unique<hilti::rt::Resumable>(std::move(cb));
    r->run();
    return std::move(*r);
}

/* __HILTI_LINKER_V1__
{"module":"Foo","namespace":"__hlt::Foo","path":"<...>/yield.hlt","version":1}
*/

