[llvm] cmake: Derive CMake system name from a triple via new mechanism (PR #208773)
Alexis Engelke via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 30 06:30:30 PDT 2026
================
@@ -0,0 +1,196 @@
+#!/usr/bin/env python3
+# ===----------------------------------------------------------------------===##
+#
+# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+# See https://llvm.org/LICENSE.txt for license information.
+# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+#
+# ===----------------------------------------------------------------------===##
+"""Tests for get_triple_system_name.
+
+These guard against the Python .def parser drifting from TripleNames.def
+The C++ side is kept in sync by the compiler (the
+generated switch cases must cover every enum), so the risk here is the regex
+silently dropping a row the C++ accepts. We check that every TRIPLE_OS /
+TRIPLE_OS_ALIAS / TRIPLE_ENV macro line in the .def is captured by the parser.
+"""
+
+import re
+import unittest
+
+import get_triple_system_name as g
+
+
+class ParseTest(unittest.TestCase):
----------------
aengelke wrote:
This also seems pretty over-engineered for what it does?
https://github.com/llvm/llvm-project/pull/208773
More information about the llvm-commits
mailing list