<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - SmallBitVector::find_last gives incorrect results with small types"
   href="https://bugs.llvm.org/show_bug.cgi?id=38996">38996</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>SmallBitVector::find_last gives incorrect results with small types
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Windows NT
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Support Libraries
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>llvm-dev@redking.me.uk
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, zturner@google.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>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</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>