From: Reid Kleckner Date: Fri, 29 Aug 2014 22:06:20 +0000 (+0000) Subject: Fix my broken test cases. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a0389164113aea7920d479edb0d26d5bf8dc2b44;p=clang Fix my broken test cases. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216791 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/CodeGenCXX/microsoft-abi-virtual-member-pointers.cpp b/test/CodeGenCXX/microsoft-abi-virtual-member-pointers.cpp index 1880f04576..b5db7c7881 100644 --- a/test/CodeGenCXX/microsoft-abi-virtual-member-pointers.cpp +++ b/test/CodeGenCXX/microsoft-abi-virtual-member-pointers.cpp @@ -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: } diff --git a/test/CodeGenCXX/microsoft-abi-vmemptr-fastcall.cpp b/test/CodeGenCXX/microsoft-abi-vmemptr-fastcall.cpp index 9d55383d65..6d42b8504a 100644 --- a/test/CodeGenCXX/microsoft-abi-vmemptr-fastcall.cpp +++ b/test/CodeGenCXX/microsoft-abi-vmemptr-fastcall.cpp @@ -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; }