[PATCH] D28572: [utils] Improve extraction of check prefixes from RUN lines

Nikolai Bozhenov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jan 14 01:50:30 PST 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL292008: [utils] Improve extraction of check prefixes from RUN lines (authored by n.bozhenov).

Changed prior to commit:
  https://reviews.llvm.org/D28572?vs=84002&id=84441#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D28572

Files:
  llvm/trunk/utils/update_llc_test_checks.py
  llvm/trunk/utils/update_test_checks.py


Index: llvm/trunk/utils/update_test_checks.py
===================================================================
--- llvm/trunk/utils/update_test_checks.py
+++ llvm/trunk/utils/update_test_checks.py
@@ -66,7 +66,7 @@
     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 @@
       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']
 
Index: llvm/trunk/utils/update_llc_test_checks.py
===================================================================
--- llvm/trunk/utils/update_llc_test_checks.py
+++ llvm/trunk/utils/update_llc_test_checks.py
@@ -54,7 +54,7 @@
 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 @@
       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']
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D28572.84441.patch
Type: text/x-patch
Size: 2284 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170114/8d524385/attachment.bin>


More information about the llvm-commits mailing list