| // For MSVC ABI compatibility, all structures returned by value using the |
| // thiscall calling convention must use the hidden parameter. |
| // RUN: %clang_cc1 -triple i386-PC-Win32 %s -fms-compatibility -emit-llvm -o - | FileCheck %s |
| // This structure would normally be returned via EAX |
| // This structure would normally be returned via EAX/EDX |
| struct S __attribute__((thiscall)) Small() const { |
| struct M __attribute__((thiscall)) Medium() const { |
| // CHECK-LABEL: define void @_Z4testv() |
| // CHECK: call void @_ZN1CC1Ev(%class.C* [[C:%.+]]) |
| // CHECK: call x86_thiscallcc void @_ZNK1C5SmallEv(%struct.S* sret %{{.+}}, %class.C* [[C]]) |
| // CHECK: call x86_thiscallcc void @_ZNK1C6MediumEv(%struct.M* sret %{{.+}}, %class.C* [[C]]) |