Index: lib/CodeGen/CGVTables.cpp =================================================================== --- lib/CodeGen/CGVTables.cpp +++ lib/CodeGen/CGVTables.cpp @@ -322,8 +322,6 @@ // Consider return adjustment if we have ThunkInfo. if (Thunk && !Thunk->Return.isEmpty()) RV = PerformReturnAdjustment(*this, ResultType, RV, *Thunk); - else if (llvm::CallInst* Call = dyn_cast(CallOrInvoke)) - Call->setTailCallKind(llvm::CallInst::TCK_Tail); // Emit return. if (!ResultType->isVoidType() && Slot.isNull()) Index: test/CodeGenCXX/microsoft-abi-structors.cpp =================================================================== --- test/CodeGenCXX/microsoft-abi-structors.cpp +++ test/CodeGenCXX/microsoft-abi-structors.cpp @@ -177,9 +177,8 @@ // Do an adjustment from B* to C*. // DTORS2: getelementptr i8, i8* %{{.*}}, i32 -4 // DTORS2: bitcast i8* %{{.*}} to %"struct.dtor_in_second_nvbase::C"* -// DTORS2: %[[CALL:.*]] = tail call x86_thiscallcc i8* @"\01??_GC@dtor_in_second_nvbase@@UAEPAXI@Z" +// DTORS2: %[[CALL:.*]] = call x86_thiscallcc i8* @"\01??_GC@dtor_in_second_nvbase@@UAEPAXI@Z" // DTORS2: ret i8* %[[CALL]] - } namespace test2 { Index: test/CodeGenCXX/tail-byval.cpp =================================================================== --- /dev/null +++ test/CodeGenCXX/tail-byval.cpp @@ -0,0 +1,49 @@ +// RUN: %clang_cc1 %s -I%S -isystem %S/Inputs -emit-llvm -triple i386-apple-darwin9 -Wno-incompatible-ms-struct -o - -Os | opt - -dse -S -o - | FileCheck %s +#pragma ms_struct on + +#include + +extern "C" int rand(); + +typedef union _LARGE { + struct { + uint32_t Low; + int32_t High; + } u; + int64_t Quad; +} LARGE; + +class CRepro { +protected: + CRepro(); + virtual ~CRepro() {} +}; + +class I { +public: + virtual uint32_t Seek(LARGE L) = 0; +}; + +class CBase : public CRepro { +protected: + CBase(); + virtual ~CBase() {}; +}; + +class C : public CBase, public I { +public: + __attribute__((noinline)) + uint32_t Seek(LARGE L); + +private: + C(); + ~C() {}; +}; + +uint32_t C::Seek(LARGE L) { + return L.u.Low + L.u.High; +} +// CHECK: define i32 @_ZThn4_N1C4SeekE6_LARGE +// CHECK: store i64 +// CHECK-NOT: tail call +// CHECK: ret