aboutsummaryrefslogtreecommitdiff
path: root/llvm/utils/UpdateTestChecks/asm.py
diff options
context:
space:
mode:
authorDavid Greene <dag@cray.com>2020-01-13 12:16:35 -0600
committerDavid Greene <dag@hpe.com>2020-09-18 06:34:59 -0500
commit7c8bb409f31ebbe24ac978e123efcef961a58340 (patch)
tree6e8574b3731bdff6b5e89055cf2e32420aef33dd /llvm/utils/UpdateTestChecks/asm.py
parent09a3737384ec34c6b216e7c6b9ca768c26ffb1d1 (diff)
downloadllvm-7c8bb409f31ebbe24ac978e123efcef961a58340.zip
llvm-7c8bb409f31ebbe24ac978e123efcef961a58340.tar.gz
llvm-7c8bb409f31ebbe24ac978e123efcef961a58340.tar.bz2
[UpdateCCTestChecks] Include generated functions if asked
Add the --include-generated-funcs option to update_cc_test_checks.py so that any functions created by the compiler that don't exist in the source will also be checked. We need to maintain the output order of generated function checks so that CHECK-LABEL works properly. To do so, maintain a list of functions output for each prefix in the order they are output. Use this list to output checks for generated functions in the proper order. Differential Revision: https://reviews.llvm.org/D83004
Diffstat (limited to 'llvm/utils/UpdateTestChecks/asm.py')
-rw-r--r--llvm/utils/UpdateTestChecks/asm.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/utils/UpdateTestChecks/asm.py b/llvm/utils/UpdateTestChecks/asm.py
index dc35859..5386044 100644
--- a/llvm/utils/UpdateTestChecks/asm.py
+++ b/llvm/utils/UpdateTestChecks/asm.py
@@ -15,7 +15,7 @@ else:
##### Assembly parser
ASM_FUNCTION_X86_RE = re.compile(
- r'^_?(?P<func>[^:]+):[ \t]*#+[ \t]*@"?(?P=func)"?\n(?:\s*\.?Lfunc_begin[^:\n]*:\n)?[^:]*?'
+ r'^_?(?P<func>[^:]+):[ \t]*#+[ \t]*(@"?(?P=func)"?| -- Begin function (?P=func))\n(?:\s*\.?Lfunc_begin[^:\n]*:\n)?[^:]*?'
r'(?P<body>^##?[ \t]+[^:]+:.*?)\s*'
r'^\s*(?:[^:\n]+?:\s*\n\s*\.size|\.cfi_endproc|\.globl|\.comm|\.(?:sub)?section|#+ -- End function)',
flags=(re.M | re.S))
@@ -28,7 +28,7 @@ ASM_FUNCTION_ARM_RE = re.compile(
flags=(re.M | re.S))
ASM_FUNCTION_AARCH64_RE = re.compile(
- r'^_?(?P<func>[^:]+):[ \t]*\/\/[ \t]*@"?(?P=func)"?\n'
+ r'^_?(?P<func>[^:]+):[ \t]*\/\/[ \t]*@"?(?P=func)"?( (Function|Tail Call))?\n'
r'(?:[ \t]+.cfi_startproc\n)?' # drop optional cfi noise
r'(?P<body>.*?)\n'
# This list is incomplete
@@ -323,7 +323,8 @@ def get_triple_from_march(march):
print("Cannot find a triple. Assume 'x86'", file=sys.stderr)
return 'x86'
-def build_function_body_dictionary_for_triple(args, raw_tool_output, triple, prefixes, func_dict):
+def build_function_body_dictionary_for_triple(args, raw_tool_output, triple,
+ prefixes, func_dict, func_order):
target_handlers = {
'i686': (scrub_asm_x86, ASM_FUNCTION_X86_RE),
'x86': (scrub_asm_x86, ASM_FUNCTION_X86_RE),
@@ -366,7 +367,7 @@ def build_function_body_dictionary_for_triple(args, raw_tool_output, triple, pre
scrubber, function_re = handler
common.build_function_body_dictionary(
function_re, scrubber, [args], raw_tool_output, prefixes,
- func_dict, args.verbose, False, False)
+ func_dict, func_order, args.verbose, False, False)
##### Generator of assembly CHECK lines