Use the right definition when emitting a global variable. Fixes PR5564.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94555 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/CodeGenCXX/static-data-member.cpp b/test/CodeGenCXX/static-data-member.cpp
index 53a1d5e..b3a2af2 100644
--- a/test/CodeGenCXX/static-data-member.cpp
+++ b/test/CodeGenCXX/static-data-member.cpp
@@ -1,4 +1,14 @@
 // RUN: %clang_cc1 -emit-llvm -o - %s
+
+// CHECK: @_ZN1A1aE = constant i32 10
+
+// PR5564.
+struct A {
+  static const int a = 10;
+};
+
+const int A::a;
+
 struct S { 
   static int i;
 };