From 07111a8fb5ba30d4631b6b12d51414609a941f6f Mon Sep 17 00:00:00 2001 From: Michael Maitland Date: Wed, 11 Jun 2025 10:04:02 -0700 Subject: [PATCH] [mlir][generate-test-checks] Do not emit the autogenerated note if it exists 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. --- mlir/utils/generate-test-checks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mlir/utils/generate-test-checks.py b/mlir/utils/generate-test-checks.py index 11fb4e40072e7..f77c9688d9318 100755 --- a/mlir/utils/generate-test-checks.py +++ b/mlir/utils/generate-test-checks.py @@ -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: