diff options
author | Reid Kleckner <reid@kleckner.net> | 2014-07-10 01:58:55 +0000 |
---|---|---|
committer | Reid Kleckner <reid@kleckner.net> | 2014-07-10 01:58:55 +0000 |
commit | 677539d0afe90fe8ec6fde19d156c1e2b0d4046a (patch) | |
tree | 2dbc5817c7f73f8e8b17fb5d9b2cee1558a169c3 /clang/test/CodeGenCXX/microsoft-abi-cdecl-method-sret.cpp | |
parent | 2e28edf8e1bde1c3d1971758ed9cc3730bf1d61e (diff) | |
download | bcm5719-llvm-677539d0afe90fe8ec6fde19d156c1e2b0d4046a.tar.gz bcm5719-llvm-677539d0afe90fe8ec6fde19d156c1e2b0d4046a.zip |
MS ABI: Fix __fastcall methods that return structs
The sret paramater consumes the register after the implicit 'this'
parameter, as with other calling conventions.
Fixes PR20278, which turned out to be very easy.
llvm-svn: 212669
Diffstat (limited to 'clang/test/CodeGenCXX/microsoft-abi-cdecl-method-sret.cpp')
-rw-r--r-- | clang/test/CodeGenCXX/microsoft-abi-cdecl-method-sret.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/microsoft-abi-cdecl-method-sret.cpp b/clang/test/CodeGenCXX/microsoft-abi-cdecl-method-sret.cpp index 2f8a66ea8e8..da58c461dcc 100644 --- a/clang/test/CodeGenCXX/microsoft-abi-cdecl-method-sret.cpp +++ b/clang/test/CodeGenCXX/microsoft-abi-cdecl-method-sret.cpp @@ -33,3 +33,12 @@ int main() { // CHECK: call void {{.*}} @"\01?variadic_sret@C@@QAA?AUS@@PBDZZ" // CHECK: call void @"\01?cdecl_sret@C@@QAA?AUS@@XZ" // CHECK: call void @"\01?byval_and_sret@C@@QAA?AUS@@U2@@Z" + +// __fastcall has similar issues. +struct A { + S __fastcall f(int x); +}; +S A::f(int x) { + return S(); +} +// CHECK-LABEL: define x86_fastcallcc void @"\01?f@A@@QAI?AUS@@H@Z"(%struct.A* inreg %this, %struct.S* inreg noalias sret %agg.result, i32 %x) |