[llvm-bugs] [Bug 49273] New: ConstantRangeTest.cpp missing things in "exhaustive" test

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Feb 19 14:41:45 PST 2021


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

            Bug ID: 49273
           Summary: ConstantRangeTest.cpp missing things in "exhaustive"
                    test
           Product: new-bugs
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: paul_robinson at playstation.sony.com
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org

In ConstantRangeTest.cpp, `testBinarySetOperationExhaustive` appears to be
iterating through a bunch of combinations of ConstantRange in order to test
some other operation.

Leading up to line 585, there is the following code:

    // Unsigned: Non-wrapped set, then smaller set, then any set.
    bool Variant1Full = Variant1.isFullSet() || Variant1.isWrappedSet();
    bool Variant2Full = Variant2.isFullSet() || Variant2.isWrappedSet();
    if (!Variant1Full && Variant2Full)
      EXPECT_EQ(Variant1, UnsignedCR);
    else if (Variant1Full && !Variant2Full)
      EXPECT_EQ(Variant2, UnsignedCR);  // << line 585
    ...

That test assertion is never executed, because Variant2Full is always true.
In fact you can `assert(Variant2Full);` immediately after its assignment,
and the assertion never triggers.

This suggests that the code to iterate through the Variant1/Variant2 
combinations isn't hitting everything it should be, or possibly there is
some other problem.  This is an area I have no context for, so I have no
patches to suggest.

Found by the Rotten Green Tests project.

-- 
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/20210219/1a149261/attachment.html>


More information about the llvm-bugs mailing list