aboutsummaryrefslogtreecommitdiff
path: root/llvm/utils/UpdateTestChecks
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/utils/UpdateTestChecks')
-rw-r--r--llvm/utils/UpdateTestChecks/common.py1
-rw-r--r--llvm/utils/UpdateTestChecks/mir.py11
2 files changed, 10 insertions, 2 deletions
diff --git a/llvm/utils/UpdateTestChecks/common.py b/llvm/utils/UpdateTestChecks/common.py
index 2dad16a..baa0377 100644
--- a/llvm/utils/UpdateTestChecks/common.py
+++ b/llvm/utils/UpdateTestChecks/common.py
@@ -605,6 +605,7 @@ TRIPLE_IR_RE = re.compile(r'^\s*target\s+triple\s*=\s*"([^"]+)"$')
TRIPLE_ARG_RE = re.compile(r"-m?triple[= ]([^ ]+)")
MARCH_ARG_RE = re.compile(r"-march[= ]([^ ]+)")
DEBUG_ONLY_ARG_RE = re.compile(r"-debug-only[= ]([^ ]+)")
+STOP_PASS_RE = re.compile(r"-stop-(before|after)=(\w+)")
IS_DEBUG_RECORD_RE = re.compile(r"^(\s+)#dbg_")
IS_SWITCH_CASE_RE = re.compile(r"^\s+i\d+ \d+, label %\S+")
diff --git a/llvm/utils/UpdateTestChecks/mir.py b/llvm/utils/UpdateTestChecks/mir.py
index 24bb8b3..01ee0e1 100644
--- a/llvm/utils/UpdateTestChecks/mir.py
+++ b/llvm/utils/UpdateTestChecks/mir.py
@@ -163,13 +163,15 @@ def add_mir_checks_for_function(
print_fixed_stack,
first_check_is_next,
at_the_function_name,
+ check_indent=None,
):
printed_prefixes = set()
for run in run_list:
for prefix in run[0]:
if prefix in printed_prefixes:
break
- if not func_dict[prefix][func_name]:
+ # func_info can be empty if there was a prefix conflict.
+ if not func_dict[prefix].get(func_name):
continue
if printed_prefixes:
# Add some space between different check prefixes.
@@ -185,6 +187,7 @@ def add_mir_checks_for_function(
func_dict[prefix][func_name],
print_fixed_stack,
first_check_is_next,
+ check_indent,
)
break
else:
@@ -204,6 +207,7 @@ def add_mir_check_lines(
func_info,
print_fixed_stack,
first_check_is_next,
+ check_indent=None,
):
func_body = str(func_info).splitlines()
if single_bb:
@@ -220,7 +224,10 @@ def add_mir_check_lines(
first_line = func_body[0]
indent = len(first_line) - len(first_line.lstrip(" "))
# A check comment, indented the appropriate amount
- check = "{:>{}}; {}".format("", indent, prefix)
+ if check_indent is not None:
+ check = "{}; {}".format(check_indent, prefix)
+ else:
+ check = "{:>{}}; {}".format("", indent, prefix)
output_lines.append("{}-LABEL: name: {}".format(check, func_name))