Fix r137086 to actually work properly in general.  PR10650.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137574 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/CodeGenCXX/reference-cast.cpp b/test/CodeGenCXX/reference-cast.cpp
index 549434e..1d08b2b 100644
--- a/test/CodeGenCXX/reference-cast.cpp
+++ b/test/CodeGenCXX/reference-cast.cpp
@@ -181,3 +181,14 @@
   // CHECK-NEXT: ret i32 [[VVAL_I]]
   return static_cast<const unsigned &>(v);
 }
+
+namespace PR10650 {
+  struct Helper {
+    unsigned long long id();
+  };
+  unsigned long long test(Helper *obj) {
+    return static_cast<const unsigned long long&>(obj->id());
+  }
+  // CHECK: define i64 @_ZN7PR106504testEPNS_6HelperE
+  // CHECK: store i64
+}