]> granicus.if.org Git - clang/commitdiff
Fix my broken test cases.
authorReid Kleckner <reid@kleckner.net>
Fri, 29 Aug 2014 22:06:20 +0000 (22:06 +0000)
committerReid Kleckner <reid@kleckner.net>
Fri, 29 Aug 2014 22:06:20 +0000 (22:06 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216791 91177308-0d34-0410-b5e6-96231b3b80d8

test/CodeGenCXX/microsoft-abi-virtual-member-pointers.cpp
test/CodeGenCXX/microsoft-abi-vmemptr-fastcall.cpp

index 1880f045762715bf93b7df94af5d326c33adb998..b5db7c7881b56d42d240fe899af012bc402e404a 100644 (file)
@@ -18,7 +18,6 @@ struct C {
   virtual int bar(int, double);
   virtual S baz(int);
   virtual S qux(U);
-  virtual S __fastcall zed(U);
 };
 
 namespace {
@@ -44,9 +43,6 @@ void f() {
   S (C::*ptr5)(U);
   ptr5 = &C::qux;
 
-  S (__fastcall C::*ptr6)(U);
-  ptr6 = &C::zed;
-
 
 // CHECK32-LABEL: define void @"\01?f@@YAXXZ"()
 // CHECK32: store i8* bitcast (void (%struct.C*, ...)* @"\01??_9C@@$BA@AE" to i8*), i8** %ptr
@@ -66,7 +62,7 @@ void f() {
 
 // Thunk for calling the 1st virtual function in C with no parameters.
 // CHECK32-LABEL: define linkonce_odr x86_thiscallcc void @"\01??_9C@@$BA@AE"(%struct.C* %this, ...)
-// CHECK32:             unnamed_addr
+// CHECK32-NOT:             unnamed_addr
 // CHECK32: [[VPTR:%.*]] = getelementptr inbounds void (%struct.C*, ...)** %{{.*}}, i64 0
 // CHECK32: [[CALLEE:%.*]] = load void (%struct.C*, ...)** [[VPTR]]
 // CHECK32: musttail call x86_thiscallcc void (%struct.C*, ...)* [[CALLEE]](%struct.C* %{{.*}}, ...)
@@ -74,7 +70,7 @@ void f() {
 // CHECK32: }
 //
 // CHECK64-LABEL: define linkonce_odr void @"\01??_9C@@$BA@AA"(%struct.C* %this, ...)
-// CHECK64:             unnamed_addr
+// CHECK64-NOT:             unnamed_addr
 // CHECK64: [[VPTR:%.*]] = getelementptr inbounds void (%struct.C*, ...)** %{{.*}}, i64 0
 // CHECK64: [[CALLEE:%.*]] = load void (%struct.C*, ...)** [[VPTR]]
 // CHECK64: musttail call void (%struct.C*, ...)* [[CALLEE]](%struct.C* %{{.*}}, ...)
@@ -141,19 +137,3 @@ void f() {
 // CHECK64: musttail call void (%struct.C*, ...)* [[CALLEE]](%struct.C* %{{.*}}, ...)
 // CHECK64: ret void
 // CHECK64: }
-
-// Thunk for calling the fifth virtual function in C, taking a struct parameter
-// and returning a struct.
-// CHECK32-LABEL: define linkonce_odr x86_fastcallcc void @"\01??_9C@@$BBA@AE"(%struct.C* inreg %this, ...)
-// CHECK32: [[VPTR:%.*]] = getelementptr inbounds void (%struct.C*, ...)** %{{.*}}, i64 4
-// CHECK32: [[CALLEE:%.*]] = load void (%struct.C*, ...)** [[VPTR]]
-// CHECK32: musttail call x86_fastcallcc void (%struct.C*, ...)* [[CALLEE]](%struct.C* inreg %{{.*}}, ...)
-// CHECK32-NEXT: ret void
-// CHECK32: }
-//
-// CHECK64-LABEL: define linkonce_odr void @"\01??_9C@@$BCA@AA"(%struct.C* %this, ...)
-// CHECK64: [[VPTR:%.*]] = getelementptr inbounds void (%struct.C*, ...)** %{{.*}}, i64 4
-// CHECK64: [[CALLEE:%.*]] = load void (%struct.C*, ...)** [[VPTR]]
-// CHECK64: musttail call void (%struct.C*, ...)* [[CALLEE]](%struct.C* %{{.*}}, ...)
-// CHECK64: ret void
-// CHECK64: }
index 9d55383d656fdd2da6dac773574cc6d9b5710a66..6d42b8504abfdff1db55780e048cb498d9c074e6 100644 (file)
@@ -1,11 +1,11 @@
-// RUN: %clang_cc1 -triple i686-pc-windows-msvc %s -emit-llvm-only -verify
+// 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.
 
 struct A {
-  virtual void __fastcall f(int a, int b);
+  virtual void __fastcall f(int a, int b); // expected-error {{cannot compile this pointer to fastcall virtual member function yet}}
 };
 void (__fastcall A::*doit())(int, int) {
-  return &A::f; // expected-error {{cannot compile this pointer to fastcall virtual member function yet}}
+  return &A::f;
 }