[llvm] [UTC] Don't rename %. inside quoted strings in test checkseg (PR #218767)

Krzysztof Drewniak via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 26 11:53:40 PDT 2026


================
@@ -1927,7 +1930,13 @@ def escape_braces(match_obj):
     if ginfo.is_ir():
         for i, line in enumerate(lines):
             # An IR variable named '%.' matches the FileCheck regex string.
-            line = line.replace("%.", "%dot")
+            # Skip quoted strings: a '%.' inside one, as in the description of
+            # an alias scope named after a callee's argument, is text that
+            # nothing later generalizes away, so renaming it would leave a
+            # check line that cannot match the input it came from.
+            line = IR_QUOTED_STRING_OR_DOT_VALUE_RE.sub(
+                lambda m: m.group(0) if m.group(0).startswith('"') else "%dot", line
----------------
krzysz00 wrote:

Done

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


More information about the llvm-commits mailing list