always yield a positive number. Just print the negated result as an
unsigned number.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162163
91177308-0d34-0410-b5e6-
96231b3b80d8
void CXXNameMangler::mangleNumber(const llvm::APSInt &Value) {
if (Value.isSigned() && Value.isNegative()) {
Out << 'n';
- Value.abs().print(Out, true);
- } else
- Value.print(Out, Value.isSigned());
+ Value.abs().print(Out, /*signed*/ false);
+ } else {
+ Value.print(Out, /*signed*/ false);
+ }
}
void CXXNameMangler::mangleNumber(int64_t Number) {
test<const int&, n>();
}
}
+
+// rdar://problem/12072531
+// Test the boundary condition of minimal signed integers.
+namespace test13 {
+ template <char c> char returnChar() { return c; }
+ template char returnChar<-128>();
+ // CHECK: @_ZN6test1310returnCharILcn128EEEcv()
+
+ template <short s> short returnShort() { return s; }
+ template short returnShort<-32768>();
+ // CHECK: @_ZN6test1311returnShortILsn32768EEEsv()
+}