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(i8*)
9 declare i8* @llvm.stacksave()
10 declare void @begin(%Iter* sret)
11 declare void @plus(%Iter* sret, %Iter*, i32)
12 declare void @reverse(%frame.reverse* inalloca align 4)
14 define i32 @main() personality i32 (...)* @pers {
15 %temp.lvalue = alloca %Iter
19 %inalloca.save = call i8* @llvm.stacksave()
20 %rev_args = alloca inalloca %frame.reverse, align 4
21 %beg = getelementptr %frame.reverse, %frame.reverse* %rev_args, i32 0, i32 0
22 %end = getelementptr %frame.reverse, %frame.reverse* %rev_args, i32 0, i32 1
25 ; CHECK: subl $20, %esp
26 ; CHECK: movl %esp, %[[beg:[^ ]*]]
27 ; CHECK: leal 12(%[[beg]]), %[[end:[^ ]*]]
29 call void @begin(%Iter* sret %temp.lvalue)
32 invoke void @plus(%Iter* sret %end, %Iter* %temp.lvalue, i32 4)
33 to label %invoke.cont unwind label %lpad
35 ; Uses end as sret param.
36 ; CHECK: pushl %[[end]]
40 call void @begin(%Iter* sret %beg)
42 ; CHECK: pushl %[[beg]]
45 invoke void @reverse(%frame.reverse* inalloca align 4 %rev_args)
46 to label %invoke.cont5 unwind label %lpad
48 invoke.cont5: ; preds = %invoke.cont
49 call void @llvm.stackrestore(i8* %inalloca.save)
52 lpad: ; preds = %invoke.cont, %entry
53 %lp = landingpad { i8*, i32 }