Rework the way pointer types are handled by the RTTI builder. We now get the right linkage for indirect pointers to incomplete structs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91799 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/CodeGenCXX/rtti-layout.cpp b/test/CodeGenCXX/rtti-layout.cpp
index 609ddeb..3e97592 100644
--- a/test/CodeGenCXX/rtti-layout.cpp
+++ b/test/CodeGenCXX/rtti-layout.cpp
@@ -20,12 +20,20 @@
 }
 struct Incomplete;
 
+#define CHECK(x) if ((x)) return __LINE__;
+
 // CHECK: define i32 @_Z1fv()
 int f() {
-  if (to<__pbase_type_info>(typeid(Incomplete *)).__flags != __pbase_type_info::__incomplete_mask)
-    return 1;
-    
+  // Pointers to incomplete classes.
+  CHECK(to<__pbase_type_info>(typeid(Incomplete *)).__flags != __pbase_type_info::__incomplete_mask);
+  CHECK(to<__pbase_type_info>(typeid(Incomplete **)).__flags != __pbase_type_info::__incomplete_mask);
+  CHECK(to<__pbase_type_info>(typeid(Incomplete ***)).__flags != __pbase_type_info::__incomplete_mask);
+
+  // Member pointers.
+  CHECK(to<__pbase_type_info>(typeid(int Incomplete::*)).__flags != __pbase_type_info::__incomplete_class_mask);
+
   // Success!
+  // CHECK: ret i32 0
   return 0;
 }
 
@@ -38,7 +46,7 @@
   if (result == 0)
     printf("success!\n");
   else
-    printf("test %d failed!\n", result);
+    printf("test on line %d failed!\n", result);
 
   return result;
 }