From 066a378ca09ccc5d8074a942cf4bf1b9d4f40729 Mon Sep 17 00:00:00 2001 From: _ov4 Date: Sat, 17 Oct 2026 10:04:54 +0000 Subject: fix(driver): default native output to .exe on Windows Without -o, cpsc saved test.out on every OS, which Windows cannot run directly. Use .exe under _WIN32 and keep .out elsewhere; update the manual and architecture notes accordingly. Co-Authored-By: Claude Sonnet 5.5 --- tools/driver/main.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/driver/main.cc b/tools/driver/main.cc index 0b3033f..2908a0a 100644 --- a/tools/driver/main.cc +++ b/tools/driver/main.cc @@ -200,7 +200,12 @@ int main(int argc, char **argv) { if (OutputPath.empty() && Save) { llvm::SmallString<256> DefaultPath(InputPaths[CG.getMainUnit()]); - llvm::sys::path::replace_extension(DefaultPath, EmitIR ? ".ll" : ".out"); +#ifdef _WIN32 + const char *ExecutableExtension = ".exe"; +#else + const char *ExecutableExtension = ".out"; +#endif + llvm::sys::path::replace_extension(DefaultPath, EmitIR ? ".ll" : ExecutableExtension); OutputPath = std::string(DefaultPath); } for (const auto &InputPath : InputPaths) { -- cgit v1.3.1-4-g156e