diff options
| author | Fangrui Song <maskray@google.com> | 2018-03-14 17:47:07 +0000 |
|---|---|---|
| committer | Fangrui Song <maskray@google.com> | 2018-03-14 17:47:07 +0000 |
| commit | 56fb2b2f20622aacc4a9229d57a37a35940b57a4 (patch) | |
| tree | fa2b4920ab126db21f2f0cba4ad3ad3169117c70 | |
| parent | f1f3d57eb2a6f8bf78e61ab15353651ac0849371 (diff) | |
| download | bcm5719-llvm-56fb2b2f20622aacc4a9229d57a37a35940b57a4.tar.gz bcm5719-llvm-56fb2b2f20622aacc4a9229d57a37a35940b57a4.zip | |
Fix LLVM IR check lines in utils/update_cc_test_checks.py
Reviewers: arichardson
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D44400
llvm-svn: 327538
| -rw-r--r-- | llvm/utils/UpdateTestChecks/common.py | 15 | ||||
| -rwxr-xr-x | llvm/utils/update_cc_test_checks.py | 3 | ||||
| -rwxr-xr-x | llvm/utils/update_test_checks.py | 2 |
3 files changed, 11 insertions, 9 deletions
diff --git a/llvm/utils/UpdateTestChecks/common.py b/llvm/utils/UpdateTestChecks/common.py index 10859960812..5af554b15b5 100644 --- a/llvm/utils/UpdateTestChecks/common.py +++ b/llvm/utils/UpdateTestChecks/common.py @@ -155,12 +155,13 @@ def genericize_check_lines(lines): return lines -def add_ir_checks(output_lines, prefix_list, func_dict, func_name, opt_basename): +def add_ir_checks(output_lines, comment_marker, prefix_list, func_dict, func_name): # Label format is based on IR string. - check_label_format = "; %s-LABEL: @%s(" + check_label_format = '{} %s-LABEL: @%s('.format(comment_marker) printed_prefixes = [] - for checkprefixes, _ in prefix_list: + for p in prefix_list: + checkprefixes = p[0] for checkprefix in checkprefixes: if checkprefix in printed_prefixes: break @@ -200,13 +201,15 @@ def add_ir_checks(output_lines, prefix_list, func_dict, func_name, opt_basename) # Skip blank lines instead of checking them. if is_blank_line == True: - output_lines.append('; %s: %s' % (checkprefix, func_line)) + output_lines.append('{} {}: {}'.format( + comment_marker, checkprefix, func_line)) else: - output_lines.append('; %s-NEXT: %s' % (checkprefix, func_line)) + output_lines.append('{} {}-NEXT: {}'.format( + comment_marker, checkprefix, func_line)) is_blank_line = False # Add space between different check prefixes and also before the first # line of code in the test function. - output_lines.append(';') + output_lines.append(comment_marker) break return output_lines diff --git a/llvm/utils/update_cc_test_checks.py b/llvm/utils/update_cc_test_checks.py index 4e249f84ae5..865ebf7ff57 100755 --- a/llvm/utils/update_cc_test_checks.py +++ b/llvm/utils/update_cc_test_checks.py @@ -226,8 +226,7 @@ def main(): if added: output_lines.append('//') added.add(mangled) - # This is also used for adding IR CHECK lines. - asm.add_asm_checks(output_lines, '//', run_list, func_dict, mangled) + common.add_ir_checks(output_lines, '//', run_list, func_dict, mangled) output_lines.append(line.rstrip('\n')) # Update the test file. diff --git a/llvm/utils/update_test_checks.py b/llvm/utils/update_test_checks.py index a1b1f90a24f..9a39746753a 100755 --- a/llvm/utils/update_test_checks.py +++ b/llvm/utils/update_test_checks.py @@ -146,7 +146,7 @@ def main(): continue # Print out the various check lines here. - output_lines = common.add_ir_checks(output_lines, prefix_list, func_dict, func_name, opt_basename) + output_lines = common.add_ir_checks(output_lines, ';', prefix_list, func_dict, func_name) is_in_function_start = False if is_in_function: |

