1 ; RUN: llc < %s -mtriple=i686-pc-win32 | FileCheck %s -check-prefix=WIN32
2 ; RUN: llc < %s -mtriple=i686-pc-mingw32 | FileCheck %s -check-prefix=MINGW_X86
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=WIN32
5 ; RUN: llc < %s -O0 -mtriple=i686-pc-mingw32 | FileCheck %s -check-prefix=MINGW_X86
6 ; RUN: llc < %s -O0 -mtriple=i386-pc-linux | FileCheck %s -check-prefix=LINUX
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.
12 define void @sret1(i8* sret %x) nounwind {
15 ; WIN32: movb $42, (%eax)
16 ; WIN32-NOT: popl %eax
25 store i8 42, i8* %x, align 4
29 define void @sret2(i8* sret %x, i8 %y) nounwind {
32 ; WIN32: movb {{.*}}, (%eax)
33 ; WIN32-NOT: popl %eax
46 define void @sret3(i8* sret %x, i8* %y) nounwind {
49 ; WIN32: movb $42, (%eax)
50 ; WIN32-NOT: movb $13, (%eax)
51 ; WIN32-NOT: popl %eax
66 %struct.S4 = type { i32, i32, i32 }
68 define void @sret4(%struct.S4* noalias sret %agg.result) {
71 ; WIN32: movl $42, (%eax)
72 ; WIN32-NOT: popl %eax
81 %x = getelementptr inbounds %struct.S4* %agg.result, i32 0, i32 0
82 store i32 42, i32* %x, align 4