diff options
| author | Nikolai Bozhenov <nikolai.bozhenov@intel.com> | 2017-01-14 09:39:35 +0000 |
|---|---|---|
| committer | Nikolai Bozhenov <nikolai.bozhenov@intel.com> | 2017-01-14 09:39:35 +0000 |
| commit | 33ee40edd92cb7951114962c627642fb3156897a (patch) | |
| tree | 8a378d6d2b827c94d37fa135ee47bcf4965ac7c9 /llvm/utils | |
| parent | 9393654530fb9c4db288d073a27d057ae90cab5d (diff) | |
| download | bcm5719-llvm-33ee40edd92cb7951114962c627642fb3156897a.tar.gz bcm5719-llvm-33ee40edd92cb7951114962c627642fb3156897a.zip | |
[utils] Improve extraction of check prefixes from RUN lines
Correct handling of the following FileCheck options is implemented in
update_llc_test_checks.py and update_test_checks.py scripts:
1) -check-prefix (with a single dash)
2) -check-prefixes (with multiple prefixes)
Differential Revision: https://reviews.llvm.org/D28572
llvm-svn: 292008
Diffstat (limited to 'llvm/utils')
| -rwxr-xr-x | llvm/utils/update_llc_test_checks.py | 6 | ||||
| -rwxr-xr-x | llvm/utils/update_test_checks.py | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/llvm/utils/update_llc_test_checks.py b/llvm/utils/update_llc_test_checks.py index d077c8a8eb2..6d489a4f3b3 100755 --- a/llvm/utils/update_llc_test_checks.py +++ b/llvm/utils/update_llc_test_checks.py @@ -54,7 +54,7 @@ RUN_LINE_RE = re.compile('^\s*;\s*RUN:\s*(.*)$') TRIPLE_ARG_RE = re.compile(r'-mtriple=([^ ]+)') TRIPLE_IR_RE = re.compile(r'^target\s+triple\s*=\s*"([^"]+)"$') IR_FUNCTION_RE = re.compile('^\s*define\s+(?:internal\s+)?[^@]*@(\w+)\s*\(') -CHECK_PREFIX_RE = re.compile('--check-prefix=(\S+)') +CHECK_PREFIX_RE = re.compile('--?check-prefix(?:es)?=(\S+)') CHECK_RE = re.compile(r'^\s*;\s*([^:]+?)(?:-NEXT|-NOT|-DAG|-LABEL)?:') ASM_FUNCTION_PPC_RE = re.compile( @@ -260,8 +260,8 @@ def main(): llc_cmd_args = llc_cmd[len('llc'):].strip() llc_cmd_args = llc_cmd_args.replace('< %s', '').replace('%s', '').strip() - check_prefixes = [m.group(1) - for m in CHECK_PREFIX_RE.finditer(filecheck_cmd)] + check_prefixes = [item for m in CHECK_PREFIX_RE.finditer(filecheck_cmd) + for item in m.group(1).split(',')] if not check_prefixes: check_prefixes = ['CHECK'] diff --git a/llvm/utils/update_test_checks.py b/llvm/utils/update_test_checks.py index da26f3c513c..7d319599912 100755 --- a/llvm/utils/update_test_checks.py +++ b/llvm/utils/update_test_checks.py @@ -66,7 +66,7 @@ OPT_FUNCTION_RE = re.compile( r'^\s*define\s+(?:internal\s+)?[^@]*@(?P<func>[\w-]+?)\s*\(' r'(\s+)?[^)]*[^{]*\{\n(?P<body>.*?)^\}$', flags=(re.M | re.S)) -CHECK_PREFIX_RE = re.compile('--check-prefix=(\S+)') +CHECK_PREFIX_RE = re.compile('--?check-prefix(?:es)?=(\S+)') CHECK_RE = re.compile(r'^\s*;\s*([^:]+?)(?:-NEXT|-NOT|-DAG|-LABEL)?:') # Match things that look at identifiers, but only if they are followed by # spaces, commas, paren, or end of the string @@ -324,8 +324,8 @@ def main(): tool_cmd_args = tool_cmd[len(tool_basename):].strip() tool_cmd_args = tool_cmd_args.replace('< %s', '').replace('%s', '').strip() - check_prefixes = [m.group(1) - for m in CHECK_PREFIX_RE.finditer(filecheck_cmd)] + check_prefixes = [item for m in CHECK_PREFIX_RE.finditer(filecheck_cmd) + for item in m.group(1).split(',')] if not check_prefixes: check_prefixes = ['CHECK'] |

