Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into emilien/comment-prefix
Browse files Browse the repository at this point in the history
PapyChacal authored Nov 4, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
2 parents d82bb70 + ad763d8 commit 2119e69
Showing 2 changed files with 46 additions and 0 deletions.
8 changes: 8 additions & 0 deletions filecheckize/main.py
Original file line number Diff line number Diff line change
@@ -19,6 +19,11 @@ def main():
help="Input file to read. Defaults to standard input.",
)
group = parser.add_mutually_exclusive_group()
group.add_argument(
"--compact-output",
action="store_true",
help="Do not print empty lines between streaks of CHECK-NEXT.",
)
group.add_argument(
"--mlir-anonymize",
action="store_true",
@@ -76,6 +81,9 @@ def main():
print(f"{comm} {prefix}-EMPTY:")
next = True
else:
# Print empty lines between streaks of CHECK-NEXT
if next and not args.compact_output:
print("")
next = False
continue

38 changes: 38 additions & 0 deletions tests/filecheck/empty-lines.mlir
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// RUN: filecheckize %s | filecheck %s
// RUN: filecheckize --compact-output %s | filecheck %s --check-prefix COMPACT

someline
someotherline

someafterskipline
someotherafterskipline


someafter2lines
someotherafter2lines



someafter3lines
someotherafter3lines

// CHECK: // CHECK: someline
// CHECK-NEXT: // CHECK-NEXT: someotherline
// CHECK-EMPTY:
// CHECK-NEXT: // CHECK: someafterskipline
// CHECK-NEXT: // CHECK-NEXT: someotherafterskipline
// CHECK-EMPTY:
// CHECK-NEXT: // CHECK: someafter2lines
// CHECK-NEXT: // CHECK-NEXT: someotherafter2lines
// CHECK-EMPTY:
// CHECK-NEXT: // CHECK: someafter3lines
// CHECK-NEXT: // CHECK-NEXT: someotherafter3lines

// COMPACT: // CHECK: someline
// COMPACT-NEXT: // CHECK-NEXT: someotherline
// COMPACT-NEXT: // CHECK: someafterskipline
// COMPACT-NEXT: // CHECK-NEXT: someotherafterskipline
// COMPACT-NEXT: // CHECK: someafter2lines
// COMPACT-NEXT: // CHECK-NEXT: someotherafter2lines
// COMPACT-NEXT: // CHECK: someafter3lines
// COMPACT-NEXT: // CHECK-NEXT: someotherafter3lines

0 comments on commit 2119e69

Please sign in to comment.