<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 - clang-cl encodes signed arbitrary precision integers incorrectly."
   href="https://bugs.llvm.org/show_bug.cgi?id=39618">39618</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>clang-cl encodes signed arbitrary precision integers incorrectly.
          </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>DebugInfo
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>zturner@google.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>jdevlieghere@apple.com, llvm-bugs@lists.llvm.org, mosescu@google.com, rnk@google.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>enum SmallSignedEnum : char {
    SSE_A = 0,
    SSE_B = 100,
    SSE_C = -100,
  };


SmallSignedEnum GlobalEnumA = SSE_A;
SmallSignedEnum GlobalEnumB = SSE_B;
SmallSignedEnum GlobalEnumC = SSE_C;

int main(int argc, char **argv) {
  return GlobalEnumA + GlobalEnumB + GlobalEnumC;
}

Compile with clang-cl and MSVC, and compare the results of dumping the
LF_ENUMERATE field list members.  For SSE_C, with clang-cl llvm-pdbutil outputs
this:

- LF_ENUMERATE [SSE_C = 18446744073709551516]

Whereas with cl, llvm-pdbutil outputs this:

- LF_ENUMERATE [SSE_C = -100]

I suspect that clang's version is equivalent to -100 mod 2^64, but we should
really be emitting the exact same byte sequence as cl, and we clearly aren't.</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>