You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found two more things that I use in tests where this filecheck seems to diverge from the official LLVM FileCheck. I have fixed my tests locally since those issues easy to bypass, but I assume you may want to know about them anyway.
The first is about CHECK-EMPTY and windows line breaks ("\r\n" instead of just "\n").
E.g. the string 1\r\n2\r\n\r\n3 fails for the directives:
CHECK: 1
CHECK-NEXT: 2
CHECK-EMPTY:
CHECK-NEXT: 3
but works with FileCheck-14 (which is the version I currently have installed.
i.e.
$ echo -e "1\r\n2\r\n\r\n3" | hexdump -C
00000000 31 0d 0a 32 0d 0a 0d 0a 33 0a |1..2....3.|
$ echo -e "1\r\n2\r\n\r\n3" | FileCheck-14 test.itest
$ echo -e "1\r\n2\r\n\r\n3" | filecheck test.itest
test.itest:3: error: CHECK-EMPTY: is not on the line after the previous match
Current position at <stdin>:2:1
^
CHECK: 1 and CHECK-NEXT: 2 seem to match fine (even with --match-full-lines) but CHECK-EMPTY fails. As soon as I change the third line break to a unix line break (even keeping the others as \r\n), it works:
echo -e "1\r\n2\r\n\n3" | filecheck test.itest
but still fails with --match-full-lines:
echo -e "1\r\n2\r\n\n3" | filecheck test.itest --match-full-lines
test.itest:3: error: CHECK-EMPTY: is not on the line after the previous match
Current position at <stdin>:1:2
2
^
I I change the line break after the 2 to a unix line break, it works again
Hi,
I found two more things that I use in tests where this filecheck seems to diverge from the official LLVM FileCheck. I have fixed my tests locally since those issues easy to bypass, but I assume you may want to know about them anyway.
The first is about
CHECK-EMPTY
and windows line breaks ("\r\n" instead of just "\n").E.g. the string
1\r\n2\r\n\r\n3
fails for the directives:but works with
FileCheck-14
(which is the version I currently have installed.i.e.
CHECK: 1
andCHECK-NEXT: 2
seem to match fine (even with--match-full-lines
) butCHECK-EMPTY
fails. As soon as I change the third line break to a unix line break (even keeping the others as\r\n
), it works:but still fails with
--match-full-lines
:I I change the line break after the 2 to a unix line break, it works again
Changing all line breaks to unix line breaks right before AND after any CHECK-EMPTY directive seems to solve all problems.
All these failing tests work with llvm FileCheck-14. This might be due to the canonicalization mentioned here: https://llvm.org/docs/CommandGuide/FileCheck.html#cmdoption-FileCheck-strict-whitespace
Cheers. I will create another issue for the second problem I found.
The text was updated successfully, but these errors were encountered: