When mangling function template specialization, mangle the type encoding of the original function template. Also, port mangle.cpp and function-template-specialization.cpp over to using FileCheck.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82114 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/CodeGenCXX/function-template-specialization.cpp b/test/CodeGenCXX/function-template-specialization.cpp
index 1efb857..e189f5d 100644
--- a/test/CodeGenCXX/function-template-specialization.cpp
+++ b/test/CodeGenCXX/function-template-specialization.cpp
@@ -1,4 +1,4 @@
-// RUN: clang-cc -emit-llvm %s -o %t &&
+// RUN: clang-cc -emit-llvm %s -o %t && FileCheck %s --input-file=%t
 template<typename T, typename U>
 T* next(T* ptr, const U& diff);
 
@@ -9,10 +9,11 @@
 
 void test(int *iptr, float *fptr, int diff) {
   // FIXME: should be "_Z4nextIiiEPT_S1_RKT0_"
-  // RUN: grep "_Z4nextIiiEPiS_RKi" %t &&
+  // CHECK: _Z4nextIiiEPT_S0_RKT0_
   iptr = next(iptr, diff);
   // FIXME: should be "_Z4nextIfiEPT_S1_RKT0_"
-  // RUN: grep "_Z4nextIfiEPfS_RKi" %t &&
+  // CHECK: _Z4nextIfiEPT_S0_RKT0_
+  
   fptr = next(fptr, diff);
 }
 
@@ -22,6 +23,6 @@
 void test2(int *iptr, double *dptr, int diff) {
   iptr = next(iptr, diff);
   // FIXME: should be "_Z4nextIdiEPT_S1_RKT0_"
-  // RUN: grep "_Z4nextIdiEPdS_RKi" %t
+  // RUN: grep "_Z4nextIiiEPT_S0_RKT0_" %t
   dptr = next(dptr, diff);
 }