diff options
author | Charles Davis <cdavis@mines.edu> | 2012-05-28 16:53:33 +0000 |
---|---|---|
committer | Charles Davis <cdavis@mines.edu> | 2012-05-28 16:53:33 +0000 |
commit | c1fd52b4b08384697428206a758125cb4a62d83f (patch) | |
tree | 7c80514bb00d9a65fe0f25bc3a32db5a4dbc806b | |
parent | 104e51f30fdf42b1f594a1be20de1c8673088c50 (diff) |
Fix mangling of integral template arguments between 1 and 10. Add a test case
for this. Reported by Timur Iskhodzhanov.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157583 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/AST/MicrosoftMangle.cpp | 4 | ||||
-rw-r--r-- | test/CodeGenCXX/mangle-ms-templates.cpp | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/lib/AST/MicrosoftMangle.cpp b/lib/AST/MicrosoftMangle.cpp index feb1fa3083..753b8174fb 100644 --- a/lib/AST/MicrosoftMangle.cpp +++ b/lib/AST/MicrosoftMangle.cpp @@ -309,8 +309,8 @@ void MicrosoftCXXNameMangler::mangleNumber(const llvm::APSInt &Value) { return; } if (Value.uge(1) && Value.ule(10)) - (Value-llvm::APSInt(llvm::APInt(Value.getBitWidth(), 1, Value.isSigned()))).print(Out, - false); + (Value-llvm::APSInt(llvm::APInt(Value.getBitWidth(), 1, Value.isSigned()), + Value.isUnsigned())).print(Out, false); else { // We have to build up the encoding in reverse order, so it will come // out right when we write it out. diff --git a/test/CodeGenCXX/mangle-ms-templates.cpp b/test/CodeGenCXX/mangle-ms-templates.cpp index b8138727a5..0a011b327e 100644 --- a/test/CodeGenCXX/mangle-ms-templates.cpp +++ b/test/CodeGenCXX/mangle-ms-templates.cpp @@ -38,6 +38,9 @@ void template_mangling() { BoolTemplate<true> _true; // CHECK: call {{.*}} @"\01??0?$BoolTemplate@$00@@QAE@XZ" + IntTemplate<5> five; +// CHECK: call {{.*}} @"\01??0?$IntTemplate@$04@@QAE@XZ" + IntTemplate<11> eleven; // CHECK: call {{.*}} @"\01??0?$IntTemplate@$0L@@@QAE@XZ" |