Correctly mangle unsigned integer literals where the high bit is set.

llvm-svn: 105312
This commit is contained in:
Anders Carlsson 2010-06-02 05:07:26 +00:00
parent 728fe444f1
commit d951a7ebf8
2 changed files with 11 additions and 2 deletions

View File

@ -1391,9 +1391,11 @@ void CXXNameMangler::mangleIntegerLiteral(QualType T,
// Boolean values are encoded as 0/1.
Out << (Value.getBoolValue() ? '1' : '0');
} else {
if (Value.isNegative())
if (Value.isSigned() && Value.isNegative()) {
Out << 'n';
Value.abs().print(Out, false);
Value.abs().print(Out, true);
} else
Value.print(Out, Value.isSigned());
}
Out << 'E';

View File

@ -489,3 +489,10 @@ namespace test11 {
// CHECK: @_ZN6test111A1fEz
void A::f(...) { }
}
namespace test12 {
// CHECK: _ZN6test121fENS_1AILt33000EEE
template <unsigned short> struct A { };
void f(A<33000>) { }
}