[llvm-bugs] [Bug 45629] New: FileCheck's --implicit-check-not doesn't flag the unexpected string after a CHECK-DAG

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Apr 21 04:28:17 PDT 2020


https://bugs.llvm.org/show_bug.cgi?id=45629

            Bug ID: 45629
           Summary: FileCheck's --implicit-check-not doesn't flag the
                    unexpected string after a CHECK-DAG
           Product: Test Suite
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: lit
          Assignee: unassignedbugs at nondot.org
          Reporter: mboehme at google.com
                CC: daniel at zuster.org, llvm-bugs at lists.llvm.org

FileCheck's `--implicit-check-not` doesn't flag the unexpected string if it
occurs after a string that was matched by a `CHECK-DAG`.

I'm not sure if this is expected behavior, but it certainly seems very
unintuitive. I suspect there may be a number of tests out there that aren't
testing what they think they're testing -- after all, an `--implicit-check-not`
that silently isn't doing anything is not going to be noticed.

I observe this behavior at git commit 5e4413896d6349a923665af2dbdae6253e8dac59
(of April 18, 2020).

To reproduce:

Create a file `check_file.txt` with the following content:

CHECK: expected
CHECK-DAG: dag1
CHECK-DAG: dag2

Ensure `FileCheck` is on the path, then run

echo expected dag1 unexpected dag2 | FileCheck check_file.txt
--implicit-check-not=unexpected
echo expected dag1 dag2 unexpected | FileCheck check_file.txt
--implicit-check-not=unexpected

Actual behavior:
`FileCheck` doesn't report any errors.

Expected behavior:
`FileCheck` should report an error for the occurence of "unexpected" in the
input.

Note:
If "unexpected" occurs in the input before the string matched by the first
`CHECK-DAG`, the behavior is as expected:

$ echo expected unexpected dag1 dag2 | FileCheck check_file.txt
--implicit-check-not=unexpected
command line:1:22: error: CHECK-NOT: excluded string found in input
-implicit-check-not='unexpected'
                     ^
<stdin>:1:10: note: found here
expected unexpected dag1 dag2

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200421/1a0eeed7/attachment.html>


More information about the llvm-bugs mailing list