From 96f51f09d4ecc034ad5c3b4afa6887b0e18c1b65 Mon Sep 17 00:00:00 2001 From: Greg Bedwell Date: Mon, 4 Jun 2018 12:30:10 +0000 Subject: [PATCH] [llvm-mca][UpdateTestChecks] Prevent an IndexError being raised when given empty input llvm-svn: 333894 --- llvm/utils/update_mca_test_checks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/utils/update_mca_test_checks.py b/llvm/utils/update_mca_test_checks.py index f99ca343f96b..dcd52f6e913c 100755 --- a/llvm/utils/update_mca_test_checks.py +++ b/llvm/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 = []