[llvm] [orc-rt] Implement Windows target triple detection (PR #224514)

Jared Wyles via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 21 01:19:30 PDT 2026


https://github.com/jaredwy updated https://github.com/llvm/llvm-project/pull/224514

>From cb6861726b19f465b6a85da48237777efa31cea4 Mon Sep 17 00:00:00 2001
From: Jared Wyles <jared.wyles at gmail.com>
Date: Fri, 18 Sep 2026 14:59:24 +1000
Subject: [PATCH] [orc-rt] Implement Windows target triple detection

---
 orc-rt/lib/bedrock/sys/windows/TargetTriple.cpp   |  8 +++++++-
 orc-rt/test/unit/bedrock/sys/TargetTripleTest.cpp | 15 ++++++++++++++-
 2 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/orc-rt/lib/bedrock/sys/windows/TargetTriple.cpp b/orc-rt/lib/bedrock/sys/windows/TargetTriple.cpp
index 465a24afc82f8..7a5db97b98f7b 100644
--- a/orc-rt/lib/bedrock/sys/windows/TargetTriple.cpp
+++ b/orc-rt/lib/bedrock/sys/windows/TargetTriple.cpp
@@ -10,6 +10,12 @@
 
 namespace orc_rt::sys {
 
-std::string detectTargetTriple() noexcept { return {}; }
+std::string detectTargetTriple() noexcept {
+#if defined(_M_X64)
+  return "x86_64-pc-windows-msvc";
+#else
+#error "Unsupported Windows architecture"
+#endif
+}
 
 } // namespace orc_rt::sys
diff --git a/orc-rt/test/unit/bedrock/sys/TargetTripleTest.cpp b/orc-rt/test/unit/bedrock/sys/TargetTripleTest.cpp
index 65675d8db58d6..ea89b209564cd 100644
--- a/orc-rt/test/unit/bedrock/sys/TargetTripleTest.cpp
+++ b/orc-rt/test/unit/bedrock/sys/TargetTripleTest.cpp
@@ -16,7 +16,7 @@
 #include <algorithm>
 
 using namespace orc_rt;
-#ifndef _WIN32
+
 TEST(TargetTripleTest, NotEmpty) {
   EXPECT_FALSE(sys::detectTargetTriple().empty());
 }
@@ -46,6 +46,7 @@ TEST(TargetTripleTest, ArchMatchesCompileTarget) {
 
 TEST(TargetTripleTest, OSMatchesCompileTarget) {
   auto Triple = sys::detectTargetTriple();
+<<<<<<< HEAD
 #if defined(__APPLE__)
   EXPECT_NE(Triple.find("-apple-"), std::string::npos);
 #elif defined(__linux__)
@@ -53,6 +54,18 @@ TEST(TargetTripleTest, OSMatchesCompileTarget) {
 #endif
 }
 #endif
+=======
+
+#if defined(__APPLE__)
+    EXPECT_NE(Triple.find("-apple-"), std::string::npos);
+#elif defined(__linux__)
+      EXPECT_NE(Triple.find("-linux-"), std::string::npos);
+#elif defined(_WIN32)
+      EXPECT_NE(Triple.find("-windows-"), std::string::npos);
+#endif
+}
+
+>>>>>>> 4504f54e6dad ([orc-rt] Implement Windows target triple detection)
 TEST(TargetTripleTest, CachedResultIsIdempotent) {
   EXPECT_EQ(sys::detectTargetTriple(), sys::detectTargetTriple());
 }



More information about the llvm-commits mailing list