From 14d1a66e677932d20a2ba6f440e310b2bd57931b Mon Sep 17 00:00:00 2001 From: Greg Bedwell Date: Mon, 4 Jun 2018 12:30:10 +0000 Subject: [llvm-mca][UpdateTestChecks] Prevent an IndexError being raised when given empty input git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@333894 91177308-0d34-0410-b5e6-96231b3b80d8 --- utils/update_mca_test_checks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'utils/update_mca_test_checks.py') diff --git a/utils/update_mca_test_checks.py b/utils/update_mca_test_checks.py index f99ca343f96..dcd52f6e913 100755 --- a/utils/update_mca_test_checks.py +++ b/utils/update_mca_test_checks.py @@ -409,7 +409,7 @@ def _write_output(test_path, input_lines, prefix_list, block_infos, # noqa continue # Add a blank line before the new checks if required. - if output_lines[-1]: + if len(output_lines) > 0 and output_lines[-1]: output_lines.append('') output_check_lines = [] -- cgit v1.2.3