Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NFC] Fix note about manually generated test output #7221

Merged
merged 2 commits into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions scripts/update_lit_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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+).*')
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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):
Expand Down
4 changes: 2 additions & 2 deletions test/lit/passes/memory-copy-fill-lowering.wast
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Loading