Use createGlobalVariable for creating vtable variables too.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90679 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/CodeGenCXX/vtable-linkage.cpp b/test/CodeGenCXX/vtable-linkage.cpp
index 3a1d8f3..39435a3 100644
--- a/test/CodeGenCXX/vtable-linkage.cpp
+++ b/test/CodeGenCXX/vtable-linkage.cpp
@@ -1,18 +1,24 @@
 // RUN: clang-cc %s -triple=x86_64-apple-darwin10 -emit-llvm -o - | FileCheck %s
 
 namespace {
-  // The vtables should have internal linkage.
   struct A {
     virtual void f() { }
   };
-  
-  struct B : virtual A {
-    virtual void f() { } 
-  };
-
-  // CHECK: @_ZTVN12_GLOBAL__N_11BE = internal constant
-  // CHECK: @_ZTTN12_GLOBAL__N_11BE = internal constant
-  // CHECK: @_ZTVN12_GLOBAL__N_11AE = internal constant
 }
 
-void f() { B b; }
+void f() { A b; }
+
+struct B {
+  B();
+  virtual void f();
+};
+
+B::B() { }
+
+// B has a key function that is not defined in this translation unit so its vtable
+// has external linkage.
+// CHECK: @_ZTV1B = external constant
+
+// The A vtable should have internal linkage since it is inside an anonymous 
+// namespace.
+// CHECK: @_ZTVN12_GLOBAL__N_11AE = internal constant