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: unassignedb...@nondot.org
          Reporter: llvm-...@redking.me.uk
                CC: llvm-bugs@lists.llvm.org, ztur...@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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to