summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/microsoft-abi-vmemptr-fastcall.cpp
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2015-06-11 00:45:44 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2015-06-11 00:45:44 +0000
commitac936ff5ab80256b7c6484b9b0252a451d2e71b9 (patch)
tree4580dec180217c5ec80094cd9bf54868d6c081e8 /clang/test/CodeGenCXX/microsoft-abi-vmemptr-fastcall.cpp
parent01b9bb42d43a041bbe75c56d3dd70c15e3cdc3a6 (diff)
downloadbcm5719-llvm-ac936ff5ab80256b7c6484b9b0252a451d2e71b9.tar.gz
bcm5719-llvm-ac936ff5ab80256b7c6484b9b0252a451d2e71b9.zip
[MS ABI] Allow fastcall member function pointers to get CodeGen'd
This restriction appears unnecessary and most likely came about during early work for musttail. llvm-svn: 239500
Diffstat (limited to 'clang/test/CodeGenCXX/microsoft-abi-vmemptr-fastcall.cpp')
-rw-r--r--clang/test/CodeGenCXX/microsoft-abi-vmemptr-fastcall.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/clang/test/CodeGenCXX/microsoft-abi-vmemptr-fastcall.cpp b/clang/test/CodeGenCXX/microsoft-abi-vmemptr-fastcall.cpp
index 6d42b8504ab..61cd58a3080 100644
--- a/clang/test/CodeGenCXX/microsoft-abi-vmemptr-fastcall.cpp
+++ b/clang/test/CodeGenCXX/microsoft-abi-vmemptr-fastcall.cpp
@@ -1,11 +1,15 @@
-// RUN: %clang_cc1 -fms-extensions -triple i686-pc-windows-msvc %s -emit-llvm-only -verify
-
-// We reject this because LLVM doesn't forward the second regparm through the
-// thunk.
+// RUN: %clang_cc1 -fms-extensions -triple i686-pc-windows-msvc %s -emit-llvm -o - | FileCheck %s
struct A {
- virtual void __fastcall f(int a, int b); // expected-error {{cannot compile this pointer to fastcall virtual member function yet}}
+ virtual void __fastcall f(int a, int b);
};
void (__fastcall A::*doit())(int, int) {
return &A::f;
}
+
+// CHECK: define linkonce_odr x86_fastcallcc void @"\01??_9A@@$BA@AI"(%struct.A* inreg %this, ...) {{.*}} comdat align 2 {
+// CHECK: [[VPTR:%.*]] = getelementptr inbounds void (%struct.A*, ...)*, void (%struct.A*, ...)** %vtable, i64 0
+// CHECK: [[CALLEE:%.*]] = load void (%struct.A*, ...)*, void (%struct.A*, ...)** [[VPTR]]
+// CHECK: musttail call x86_fastcallcc void (%struct.A*, ...) [[CALLEE]](%struct.A* inreg %{{.*}}, ...)
+// CHECK: ret void
+// CHECK: }
OpenPOWER on IntegriCloud