1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-18 18:42:46 +02:00

[update_cc_test_checks.py] Use CHECK_RE from common

Summary:
This change modifies the common.CHECK_RE regex to also handle '//'
comment prefixes which allows us to share it between clang and IR tests.
Using the regex from common means that *-SAME lines are also stripped
now. Before this change using the --function-signature flag would result
in -SAME: lines from previous runs not being removed.

Reviewers: MaskRay, jdoerfert

Reviewed By: jdoerfert

Subscribers: jdoerfert, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D70890
This commit is contained in:
Alex Richardson 2019-12-02 18:18:47 +00:00
parent 48e119873e
commit d1d332153d
2 changed files with 2 additions and 4 deletions

View File

@ -61,7 +61,7 @@ def invoke_tool(exe, cmd_args, ir):
RUN_LINE_RE = re.compile(r'^\s*(?://|[;#])\s*RUN:\s*(.*)$')
CHECK_PREFIX_RE = re.compile(r'--?check-prefix(?:es)?[= ](\S+)')
PREFIX_RE = re.compile('^[a-zA-Z0-9_-]+$')
CHECK_RE = re.compile(r'^\s*[;#]\s*([^:]+?)(?:-NEXT|-NOT|-DAG|-LABEL|-SAME)?:')
CHECK_RE = re.compile(r'^\s*(?://|[;#])\s*([^:]+?)(?:-NEXT|-NOT|-DAG|-LABEL|-SAME)?:')
OPT_FUNCTION_RE = re.compile(
r'^\s*define\s+(?:internal\s+)?[^@]*@(?P<func>[\w-]+?)\s*'

View File

@ -28,8 +28,6 @@ from UpdateTestChecks import asm, common
ADVERT = '// NOTE: Assertions have been autogenerated by '
CHECK_RE = re.compile(r'^\s*//\s*([^:]+?)(?:-NEXT|-NOT|-DAG|-LABEL)?:')
SUBST = {
'%clang': [],
'%clang_cc1': ['-cc1'],
@ -238,7 +236,7 @@ def main():
input_lines = []
with open(filename, 'r+') as f:
for line in f:
m = CHECK_RE.match(line)
m = common.CHECK_RE.match(line)
if not (m and m.group(1) in prefix_set) and line != '//\n':
input_lines.append(line)
f.seek(0)