aboutsummaryrefslogtreecommitdiff
path: root/llvm/utils/UpdateTestChecks/common.py
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/utils/UpdateTestChecks/common.py')
-rw-r--r--llvm/utils/UpdateTestChecks/common.py40
1 files changed, 27 insertions, 13 deletions
diff --git a/llvm/utils/UpdateTestChecks/common.py b/llvm/utils/UpdateTestChecks/common.py
index a1e883d8..8e02488 100644
--- a/llvm/utils/UpdateTestChecks/common.py
+++ b/llvm/utils/UpdateTestChecks/common.py
@@ -496,6 +496,7 @@ class FunctionTestBuilder:
self._func_dict = {}
self._func_order = {}
self._global_var_dict = {}
+ self._processed_prefixes = set()
for tuple in run_list:
for prefix in tuple[0]:
self._func_dict.update({prefix:dict()})
@@ -584,30 +585,43 @@ class FunctionTestBuilder:
scrubbed_body)
if func in self._func_dict[prefix]:
- if (self._func_dict[prefix][func] is None or
- str(self._func_dict[prefix][func]) != scrubbed_body or
- self._func_dict[prefix][func].args_and_sig != args_and_sig or
- self._func_dict[prefix][func].attrs != attrs):
- if (self._func_dict[prefix][func] is not None and
- self._func_dict[prefix][func].is_same_except_arg_names(
+ if (self._func_dict[prefix][func] is not None and
+ (str(self._func_dict[prefix][func]) != scrubbed_body or
+ self._func_dict[prefix][func].args_and_sig != args_and_sig or
+ self._func_dict[prefix][func].attrs != attrs)):
+ if self._func_dict[prefix][func].is_same_except_arg_names(
scrubbed_extra,
args_and_sig,
attrs,
- is_backend)):
+ is_backend):
self._func_dict[prefix][func].scrub = scrubbed_extra
self._func_dict[prefix][func].args_and_sig = args_and_sig
- continue
else:
# This means a previous RUN line produced a body for this function
# that is different from the one produced by this current RUN line,
# so the body can't be common accross RUN lines. We use None to
# indicate that.
self._func_dict[prefix][func] = None
- continue
-
- self._func_dict[prefix][func] = function_body(
- scrubbed_body, scrubbed_extra, args_and_sig, attrs, func_name_separator)
- self._func_order[prefix].append(func)
+ else:
+ if prefix not in self._processed_prefixes:
+ self._func_dict[prefix][func] = function_body(
+ scrubbed_body, scrubbed_extra, args_and_sig, attrs,
+ func_name_separator)
+ self._func_order[prefix].append(func)
+ else:
+ # An earlier RUN line used this check prefixes but didn't produce
+ # a body for this function. This happens in Clang tests that use
+ # preprocesser directives to exclude individual functions from some
+ # RUN lines.
+ self._func_dict[prefix][func] = None
+
+ def processed_prefixes(self, prefixes):
+ """
+ Mark a set of prefixes as having had at least one applicable RUN line fully
+ processed. This is used to filter out function bodies that don't have
+ outputs for all RUN lines.
+ """
+ self._processed_prefixes.update(prefixes)
def get_failed_prefixes(self):
# This returns the list of those prefixes that failed to match any function,