diff --git a/llvm/utils/UpdateTestChecks/common.py b/llvm/utils/UpdateTestChecks/common.py --- a/llvm/utils/UpdateTestChecks/common.py +++ b/llvm/utils/UpdateTestChecks/common.py @@ -71,7 +71,8 @@ SCRUB_KILL_COMMENT_RE = re.compile(r'^ *#+ +kill:.*\n') SCRUB_LOOP_COMMENT_RE = re.compile( r'# =>This Inner Loop Header:.*|# in Loop:.*', flags=re.M) - +SCRUB_FILECHECK_REGEX_RE = re.compile(r'{{') +SCRUB_FILECHECK_REGEX_REPLACEMENT = r'{{[{][{]}}' def error(msg, test_file=None): if test_file: @@ -91,6 +92,8 @@ body = string.expandtabs(body, 2) # Strip trailing whitespace. body = SCRUB_TRAILING_WHITESPACE_RE.sub(r'', body) + # Munge anything that could be interpreted as a FileCheck regexp. + body = SCRUB_FILECHECK_REGEX_RE.sub(SCRUB_FILECHECK_REGEX_REPLACEMENT, body) return body def do_scrub(body, scrubber, scrubber_args, extra):