Index: llvm/utils/lit/lit/TestRunner.py =================================================================== --- llvm/utils/lit/lit/TestRunner.py +++ llvm/utils/lit/lit/TestRunner.py @@ -49,7 +49,7 @@ # This regex captures ARG. ARG must not contain a right parenthesis, which # terminates %dbg. ARG must not contain quotes, in which ARG might be enclosed # during expansion. -kPdbgRegex = '%dbg\(([^)\'"]*)\)' +kPdbgRegex = '%dbg\\(([^)\'"]*)\\)' class ShellEnvironment(object): @@ -1420,14 +1420,14 @@ # Trim trailing whitespace. line = line.rstrip() # Substitute line number expressions - line = re.sub('%\(line\)', str(line_number), line) + line = re.sub(r'%\(line\)', str(line_number), line) def replace_line_number(match): if match.group(1) == '+': return str(line_number + int(match.group(2))) if match.group(1) == '-': return str(line_number - int(match.group(2))) - line = re.sub('%\(line *([\+-]) *(\d+)\)', replace_line_number, line) + line = re.sub(r'%\(line *([\+-]) *(\d+)\)', replace_line_number, line) # Collapse lines with trailing '\\'. if output and output[-1][-1] == '\\': output[-1] = output[-1][:-1] + line