From a8a89c77ea3c16b45763fca6940bbfd3bef7884f Mon Sep 17 00:00:00 2001 From: Simon Atanasyan Date: Wed, 30 Oct 2019 19:52:16 +0300 Subject: [utils] Reflow asm check generation to tolerate blank lines This change introduces two fixes. The second fix allows to generate a test to check the first fix. - Output `CHECK-EMPTY` prefix for an empty line in ASM output. Before that fix `update_llc_test_checks.py` incorrectly emits `CHECK-NEXT: ` prefix. - Fix the `ASM_FUNCTION_MIPS_RE` regex to stop on a real function epilogue not on an inline assembler prologue and include inline assembler code into a test. Differential Revision: https://reviews.llvm.org/D47192 --- llvm/utils/UpdateTestChecks/common.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'llvm/utils/UpdateTestChecks/common.py') diff --git a/llvm/utils/UpdateTestChecks/common.py b/llvm/utils/UpdateTestChecks/common.py index 76b9d4e80c9..9da8619915b 100644 --- a/llvm/utils/UpdateTestChecks/common.py +++ b/llvm/utils/UpdateTestChecks/common.py @@ -260,7 +260,10 @@ def add_checks(output_lines, comment_marker, prefix_list, func_dict, func_name, if is_asm: output_lines.append('%s %s: %s' % (comment_marker, checkprefix, func_body[0])) for func_line in func_body[1:]: - output_lines.append('%s %s-NEXT: %s' % (comment_marker, checkprefix, func_line)) + if func_line.strip() == '': + output_lines.append('%s %s-EMPTY:' % (comment_marker, checkprefix)) + else: + output_lines.append('%s %s-NEXT: %s' % (comment_marker, checkprefix, func_line)) break # For IR output, change all defs to FileCheck variables, so we're immune -- cgit v1.2.3