[llvm-bugs] [Bug 38996] New: SmallBitVector::find_last gives incorrect results with small types

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Sep 19 05:33:31 PDT 2018


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

            Bug ID: 38996
           Summary: SmallBitVector::find_last gives incorrect results with
                    small types
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Support Libraries
          Assignee: unassignedbugs at nondot.org
          Reporter: llvm-dev at redking.me.uk
                CC: llvm-bugs at lists.llvm.org, zturner at google.com

TYPED_TEST(BitVectorTest, SmallFind) {
  TypeParam Vec(10, false);
  EXPECT_EQ(-1, Vec.find_first());
  EXPECT_EQ(-1, Vec.find_last());

  Vec.resize(11, true);
  EXPECT_EQ(10, Vec.find_first());
  EXPECT_EQ(10, Vec.find_last()); // returns 11

  Vec.resize(12, false);
  EXPECT_EQ(10, Vec.find_first());
  EXPECT_EQ(10, Vec.find_last()); // returns 11

  Vec.resize(13, true);
  EXPECT_EQ(10, Vec.find_first());
  EXPECT_EQ(12, Vec.find_last()); // returns 13
}

SmallBitVector fails these tests:

unittests\ADT\BitVectorTest.cpp(192): error:       Expected: 10
To be equal to: Vec.find_last()
      Which is: 11
unittests\ADT\BitVectorTest.cpp(196): error:       Expected: 10
To be equal to: Vec.find_last()
      Which is: 11
unittests\ADT\BitVectorTest.cpp(200): error:       Expected: 12
To be equal to: Vec.find_last()
      Which is: 13

-- 
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/20180919/7ad52c6f/attachment.html>


More information about the llvm-bugs mailing list