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

            Bug ID: 39618
           Summary: clang-cl encodes signed arbitrary precision integers
                    incorrectly.
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: DebugInfo
          Assignee: unassignedb...@nondot.org
          Reporter: ztur...@google.com
                CC: jdevliegh...@apple.com, llvm-bugs@lists.llvm.org,
                    mose...@google.com, r...@google.com

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.

-- 
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