Pass the right type to GetAddrOfFunction when getting functions for the VTable. Fixes PR5021.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83395 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/CodeGenCXX/virtual-function-calls.cpp b/test/CodeGenCXX/virtual-function-calls.cpp
new file mode 100644
index 0000000..4002859
--- /dev/null
+++ b/test/CodeGenCXX/virtual-function-calls.cpp
@@ -0,0 +1,16 @@
+// PR5021
+struct A {
+  virtual void f(char);
+};
+
+void f(A *a) {
+  a->f('c');
+}
+// PR5021
+struct A {
+  virtual void f(char);
+};
+
+void f(A *a) {
+  a->f('c');
+}