blob: 878c6db99286fee75208c7a86e07f5ca7a3d4c23 [file] [log] [blame]
Eli Friedman32c7c252012-01-20 00:05:46 +00001; RUN: llc < %s -mtriple=i686-pc-win32 | FileCheck %s -check-prefix=WIN_X32
2; RUN: llc < %s -mtriple=i686-pc-mingw32 | FileCheck %s -check-prefix=MINGW_X32
3; RUN: llc < %s -mtriple=i386-pc-linux | FileCheck %s -check-prefix=LINUX
4; RUN: llc < %s -O0 -mtriple=i686-pc-win32 | FileCheck %s -check-prefix=WIN_X32
5; RUN: llc < %s -O0 -mtriple=i686-pc-mingw32 | FileCheck %s -check-prefix=MINGW_X32
6; RUN: llc < %s -O0 -mtriple=i386-pc-linux | FileCheck %s -check-prefix=LINUX
7
8; The SysV ABI used by most Unixes and Mingw on x86 specifies that an sret pointer
9; is callee-cleanup. However, in MSVC's cdecl calling convention, sret pointer
10; arguments are caller-cleanup like normal arguments.
11
12define void @sret1(i8* sret) nounwind {
13entry:
14; WIN_X32: {{ret$}}
15; MINGW_X32: ret $4
16; LINUX: ret $4
17 ret void
18}
19
20define void @sret2(i32* sret %x, i32 %y) nounwind {
21entry:
22; WIN_X32: {{ret$}}
23; MINGW_X32: ret $4
24; LINUX: ret $4
25 store i32 %y, i32* %x
26 ret void
27}
28