[PATCH] Fix incorrect error-less failure when combining CHECK-DAG and CHECK-NOT

Daniel Sanders Daniel.Sanders at imgtec.com
Wed Jul 24 03:51:33 PDT 2013


Hi,

I previously submitted this to bugzilla (http://llvm.org/bugs/show_bug.cgi?id=16450) but my colleague, Reed Kotler, tells me I should have sent it here. I don't have commit access so I need both approval for the patch and for someone to commit it for me.

This patch fixes a bug in FileCheck that leads to an error-less failure when combining CHECK-DAG and CHECK-NOT in certain ways. This error-less failure occurs when the test should have passed.

There are two locations in the CHECK-DAG processing that CHECK-NOT is processed and one of them is handled incorrectly. The one that is incorrect is taking the bool returned by CheckNot(), casting it to size_t, then comparing it to a large unsigned value. This comparison is always false whether the pattern is matched or not.

It seems that the existing tests only check that successful matches of the CHECK-NOT pattern trigger failures. I didn't find any tests that check that unsuccessful matches allow the test to pass.

This patch uses the result of CheckNot() directly in the if-statement without the intermediate size_t and adds a test to check-dag.txt. The test has been added to an existing test but it can be made a separate test if you prefer.

Daniel Sanders
Leading Software Design Engineer, MIPS Processor IP
Imagination Technologies Limited
www.imgtec.com<http://www.imgtec.com/>


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130724/1e70f14f/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: check-dag-check-not-fix.patch
Type: application/octet-stream
Size: 1407 bytes
Desc: check-dag-check-not-fix.patch
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130724/1e70f14f/attachment.obj>


More information about the llvm-commits mailing list