[mlir][generate-test-checks] Do not emit the autogenerated note if it exists (#143750)

Prior to this PR, the script removed the already existing autogenerated
note if we came across a line that was equal to the note. But the
default note is multiple lines, so there would never be a match.
Instead, check to see if the current line is a substring of the
autogenerated note.

Co-authored-by: Michael Maitland <michaelmaitland@meta.com>
This commit is contained in:
Michael Maitland
2025-06-11 18:18:22 -04:00
committed by GitHub
parent 9c9a4a284e
commit 74172add65

View File

@@ -208,7 +208,7 @@ def process_source_lines(source_lines, note, args):
source_segments = [[]]
for line in source_lines:
# Remove previous note.
if line == note:
if line in note:
continue
# Remove previous CHECK lines.
if line.find(args.check_prefix) != -1: