upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/runtime/src/main.cpp
diff options
context:
space:
mode:
authorkotorvr <332716892+kotorvr@users.noreply.github.com>2026-11-22 01:26:52 +0000
committerkotorvr <332716892+kotorvr@users.noreply.github.com>2026-11-22 01:26:52 +0000
commit7b1ee4b18bef179eeaa7cf0e9599922d4a552d68 (patch)
treeae84750e26ed5b26b99c18cc6029a0d18844e12f /runtime/src/main.cpp
parent5c74ec363ba1b5d7cdeeb335401c128e65fc5827 (diff)
parentc432cdce127ed2d22a99aa6ef57d91db4a10b5bb (diff)
Merge remote-tracking branch 'origin/main' into fuzz-7-w32-lane-select
# Conflicts: # tests/semantic/regen_fixtures.py
Diffstat (limited to 'runtime/src/main.cpp')
-rw-r--r--runtime/src/main.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/runtime/src/main.cpp b/runtime/src/main.cpp
index 8fbc8dc4b..8e2ac0b03 100644
--- a/runtime/src/main.cpp
+++ b/runtime/src/main.cpp
@@ -73,7 +73,7 @@ int wmain(int argc, wchar_t** argv) {
73 loader.initialise(); // TLS callbacks, then DllMain(DLL_PROCESS_ATTACH) for DLLs 73 loader.initialise(); // TLS callbacks, then DllMain(DLL_PROCESS_ATTACH) for DLLs
74 std::printf("%zu module(s) initialised\n", loader.modules().size()); 74 std::printf("%zu module(s) initialised\n", loader.modules().size());
75 } 75 }
76 int unimplemented = 0; 76 int unimplemented = 0, unimplemented_hresult = 0;
77 for (auto* m : loader.modules()) { 77 for (auto* m : loader.modules()) {
78 std::map<rt::Binding, int> counts; 78 std::map<rt::Binding, int> counts;
79 for (auto& r : m->imports) counts[r.binding]++; 79 for (auto& r : m->imports) counts[r.binding]++;
@@ -83,11 +83,18 @@ int wmain(int argc, wchar_t** argv) {
83 counts[rt::Binding::Unimplemented]); 83 counts[rt::Binding::Unimplemented]);
84 for (auto& r : m->imports) 84 for (auto& r : m->imports)
85 if (r.binding == rt::Binding::Unimplemented || r.binding == rt::Binding::Shim) { 85 if (r.binding == rt::Binding::Unimplemented || r.binding == rt::Binding::Shim) {
86 std::printf(" %-13s %s!%s\n", binding_name(r.binding), r.dll.c_str(), r.name.c_str()); 86 const bool missing = r.binding == rt::Binding::Unimplemented;
87 unimplemented += r.binding == rt::Binding::Unimplemented; 87 const bool hresult =
88 missing && rt::shims::classify_import(r.dll, r.name) == rt::shims::ReturnClass::HResult;
89 std::printf(" %-13s %s!%s%s\n", binding_name(r.binding), r.dll.c_str(), r.name.c_str(),
90 hresult ? " [returns HRESULT]" : "");
91 unimplemented += missing;
92 unimplemented_hresult += hresult;
88 } 93 }
89 } 94 }
90 std::printf("%zu module(s) mapped, %d unimplemented import(s)\n", loader.modules().size(), unimplemented); 95 std::printf("%zu module(s) mapped, %d unimplemented import(s)\n", loader.modules().size(), unimplemented);
96 std::printf("unimplemented by return policy: hresult=%d other=%d\n", unimplemented_hresult,
97 unimplemented - unimplemented_hresult);
91 if (!run) return 0; 98 if (!run) return 0;
92 if (!main_module.entry_rva) { 99 if (!main_module.entry_rva) {
93 std::fprintf(stderr, "error: %s has no entry point\n", main_module.name.c_str()); 100 std::fprintf(stderr, "error: %s has no entry point\n", main_module.name.c_str());