Skip to content

Commit 4e7c0a3

Browse files
committed
Update MLIR generate-test-checks.py to add the notice from the source into the generated file
Folks may not read the source of the tool and miss these instructions. Differential Revision: https://reviews.llvm.org/D110082
1 parent 4ceea77 commit 4e7c0a3

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

mlir/utils/generate-test-checks.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,14 @@
3232
import re
3333
import sys
3434

35-
ADVERT = '// NOTE: Assertions have been autogenerated by '
35+
ADVERT_BEGIN = '// NOTE: Assertions have been autogenerated by '
36+
ADVERT_END = """
37+
// The script is designed to make adding checks to
38+
// a test case fast, it is *not* designed to be authoritative
39+
// about what constitutes a good test! The CHECK should be
40+
// minimized and named to reflect the test intent.
41+
"""
42+
3643

3744
# Regex command to match an SSA identifier.
3845
SSA_RE_STR = '[0-9]+|[a-zA-Z$._-][a-zA-Z0-9$._-]*'
@@ -172,7 +179,7 @@ def main():
172179

173180
# Generate a note used for the generated check file.
174181
script_name = os.path.basename(__file__)
175-
autogenerated_note = (ADVERT + 'utils/' + script_name)
182+
autogenerated_note = (ADVERT_BEGIN + 'utils/' + script_name + "\n" + ADVERT_END)
176183

177184
source_segments = None
178185
if args.source:

0 commit comments

Comments
 (0)