warn(("Supplied prefix '%s' is invalid. Prefix must contain only alphanumeric characters, hyphens and underscores." + hint) %
(prefix))
+def get_check_prefixes(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']
+ return check_prefixes
def verify_filecheck_prefixes(fc_cmd):
fc_cmd_parts = fc_cmd.split()
tool_cmd_args = tool_cmd[len(opt_basename):].strip()
tool_cmd_args = tool_cmd_args.replace('< %s', '').replace('%s', '').strip()
-
- check_prefixes = [item for m in common.CHECK_PREFIX_RE.finditer(filecheck_cmd)
- for item in m.group(1).split(',')]
- if not check_prefixes:
- check_prefixes = ['CHECK']
+ check_prefixes = common.get_check_prefixes(filecheck_cmd)
# FIXME: We should use multiple check prefixes to common check lines. For
# now, we just ignore all but the last.
run_list.append((None, exe, None, None))
continue
- check_prefixes = [item for m in common.CHECK_PREFIX_RE.finditer(filecheck_cmd)
- for item in m.group(1).split(',')]
- if not check_prefixes:
- check_prefixes = ['CHECK']
+ check_prefixes = common.get_check_prefixes(filecheck_cmd)
run_list.append((check_prefixes, clang_args, commands[1:-1], triple_in_cmd))
# Execute clang, generate LLVM IR, and extract functions.
llc_cmd_args = llc_cmd_args.replace('< %s', '').replace('%s', '').strip()
if ti.path.endswith('.mir'):
llc_cmd_args += ' -x mir'
- check_prefixes = [item for m in common.CHECK_PREFIX_RE.finditer(filecheck_cmd)
- for item in m.group(1).split(',')]
- if not check_prefixes:
- check_prefixes = ['CHECK']
+ check_prefixes = common.get_check_prefixes(filecheck_cmd)
# FIXME: We should use multiple check prefixes to common check lines. For
# now, we just ignore all but the last.
tool_cmd_args = tool_cmd[len(tool_basename):].strip()
tool_cmd_args = tool_cmd_args.replace('< %s', '').replace('%s', '').strip()
- check_prefixes = [item
- for m in common.CHECK_PREFIX_RE.finditer(filecheck_cmd)
- for item in m.group(1).split(',')]
- if not check_prefixes:
- check_prefixes = ['CHECK']
+ check_prefixes = common.get_check_prefixes(filecheck_cmd)
run_infos.append((check_prefixes, tool_cmd_args))
cmd_args = llc_cmd[len('llc'):].strip()
cmd_args = cmd_args.replace('< %s', '').replace('%s', '').strip()
-
- check_prefixes = [
- item
- for m in common.CHECK_PREFIX_RE.finditer(filecheck_cmd)
- for item in m.group(1).split(',')]
- if not check_prefixes:
- check_prefixes = ['CHECK']
+ check_prefixes = common.get_check_prefixes(filecheck_cmd)
all_prefixes += check_prefixes
run_list.append(Run(check_prefixes, cmd_args, triple))
tool_cmd_args = tool_cmd[len(tool_basename):].strip()
tool_cmd_args = tool_cmd_args.replace('< %s', '').replace('%s', '').strip()
-
- check_prefixes = [item for m in
- common.CHECK_PREFIX_RE.finditer(filecheck_cmd)
- for item in m.group(1).split(',')]
- if not check_prefixes:
- check_prefixes = ['CHECK']
+ check_prefixes = common.get_check_prefixes(filecheck_cmd)
# FIXME: We should use multiple check prefixes to common check lines. For
# now, we just ignore all but the last.