Skip to content
Closed
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
10 changes: 9 additions & 1 deletion mlir/utils/generate-test-checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,18 @@ def process_source_lines(source_lines, note, args):
source_split_re = re.compile(args.source_delim_regex)

source_segments = [[]]
skip_next_empty_line = False
for line in source_lines:
# Remove previous note.
if line in note:
if line and line in note:
skip_next_empty_line = True
continue
# Skip the first empty line after the note
if skip_next_empty_line and not line:
skip_next_empty_line = False
continue
if line:
skip_next_empty_line = False
# Remove previous CHECK lines.
if line.find(args.check_prefix) != -1:
continue
Expand Down