Browse Source

[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
Greg Bedwell 7 years ago
parent
commit
14d1a66e67
1 changed files with 1 additions and 1 deletions
  1. 1 1
      utils/update_mca_test_checks.py

+ 1 - 1
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 = []