[clang] [llvm] [UpdateTestChecks][Clang][CIR] Add support for CIR in update_cc_test_checks.py (PR #241654)

Vicky Nguyen via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 16 20:30:24 PST 2026


================
@@ -685,6 +685,67 @@ def find_run_lines(test, lines):
     return run_lines
 
 
+LIT_DEFINE_RE = re.compile(
+    r"^\s*(?://|[;#])\s*(?:RE)?DEFINE:\s*(%\{[^}]+\})\s*=\s*(.*?)\s*$"
+)
+LIT_IF_RE = re.compile(
+    r"%if\s+(.*?)\s*%\{(.*?)%\}(?:\s*%else\s*%\{(.*?)%\})?"
+)
+# Expansion rounds before giving up, in case a definition refers to itself.
+MAX_LIT_DEFINE_ROUNDS = 10
+
+
+def expand_lit_defines(run_lines, input_lines):
+    """Expand lit "DEFINE: %{name} = value" substitutions in RUN lines.
+
+    REDEFINE is treated like DEFINE: the last value of a name is used for every
----------------
iamvickynguyen wrote:

Thanks @bcardosolopes and @matteo-rm for pointing these out! I'll try them and see if they work. If not, I'll add an error for REDEFINE instead of treating it like DEFINE.

https://github.com/llvm/llvm-project/pull/241654


More information about the cfe-commits mailing list