diff --git a/scripts/update_lit_checks.py b/scripts/update_lit_checks.py index b6bb213a8f7..753b967ca41 100755 --- a/scripts/update_lit_checks.py +++ b/scripts/update_lit_checks.py @@ -30,8 +30,8 @@ script_dir = os.path.dirname(__file__) script_name = os.path.basename(__file__) -NOTICE = (';; NOTE: Assertions have been generated by {script} and should not' + - ' be edited.') +NOTICE_PREFIX = f';; NOTE: Assertions have been generated by {script_name}' +NOTICE = NOTICE_PREFIX + '{args} and should not be edited.' RUN_LINE_RE = re.compile(r'^\s*;;\s*RUN:\s*(.*)$') CHECK_PREFIX_RE = re.compile(r'.*--check-prefix[= ](\S+).*') @@ -80,7 +80,7 @@ def itertests(args): with open(test) as f: lines = [line.rstrip() for line in f] first_line = lines[0] if lines else '' - if script_name not in first_line and not args.force: + if NOTICE_PREFIX not in first_line and not args.force: warn(f'Skipping test {test} which was not generated by ' f'{script_name}. Use -f to override.') continue @@ -258,12 +258,12 @@ def update_test(args, test, lines, tmp): _, kind, name = indentKindName(match) named_items.append((kind, name)) - script = script_name + notice_args = '' if all_items: - script += ' --all-items' + notice_args += ' --all-items' if output_kind != 'wat': - script += f' --output={output_kind}' - output_lines = [NOTICE.format(script=script)] + notice_args += f' --output={output_kind}' + output_lines = [NOTICE.format(args=notice_args)] def emit_checks(indent, prefix, lines): def pad(line): diff --git a/test/lit/passes/memory-copy-fill-lowering.wast b/test/lit/passes/memory-copy-fill-lowering.wast index ea5198f893a..990c2fa30de 100644 --- a/test/lit/passes/memory-copy-fill-lowering.wast +++ b/test/lit/passes/memory-copy-fill-lowering.wast @@ -1,5 +1,5 @@ -;; NOTE: These assertions have been manually generated, and cannot be updated by update_lit_checks.py -;; because of the assertion at the end (update_lit_checks.py ignores the features section because it's +;; NOTE: These assertions have been manually generated because of the assertion +;; at the end (update_lit_checks.py ignores the features section because it's ;; not semantically part of the module.) ;; RUN: wasm-opt --enable-bulk-memory %s --llvm-memory-copy-fill-lowering --emit-target-features -S -o - | filecheck %s