1 ; RUN: llc < %s -mtriple=i686-pc-win32 | FileCheck %s
3 %Iter = type { i32, i32, i32 }
5 %frame.reverse = type { %Iter, %Iter }
8 declare void @llvm.stackrestore(ptr)
9 declare ptr @llvm.stacksave()
10 declare void @begin(ptr sret(%Iter))
11 declare void @plus(ptr sret(%Iter), ptr, i32)
12 declare void @reverse(ptr inalloca(%frame.reverse) align 4)
14 define i32 @main() personality ptr @pers {
15 %temp.lvalue = alloca %Iter
19 %inalloca.save = call ptr @llvm.stacksave()
20 %rev_args = alloca inalloca %frame.reverse, align 4
21 %end = getelementptr %frame.reverse, ptr %rev_args, i32 0, i32 1
24 ; CHECK: subl $20, %esp
25 ; CHECK: movl %esp, %[[beg:[^ ]*]]
26 ; CHECK: leal 12(%[[beg]]), %[[end:[^ ]*]]
28 call void @begin(ptr sret(%Iter) %temp.lvalue)
31 invoke void @plus(ptr sret(%Iter) %end, ptr %temp.lvalue, i32 4)
32 to label %invoke.cont unwind label %lpad
34 ; Uses end as sret param.
35 ; CHECK: pushl %[[end]]
39 call void @begin(ptr sret(%Iter) %rev_args)
41 ; CHECK: pushl %[[beg]]
44 invoke void @reverse(ptr inalloca(%frame.reverse) align 4 %rev_args)
45 to label %invoke.cont5 unwind label %lpad
47 invoke.cont5: ; preds = %invoke.cont
48 call void @llvm.stackrestore(ptr %inalloca.save)
51 lpad: ; preds = %invoke.cont, %entry
52 %lp = landingpad { ptr, i32 }