1 ; RUN: llc < %s | FileCheck %s
10 ; extern "C" void takes_two(A a1, A a2);
11 ; extern "C" void passes_two() { takes_two(A(), A()); }
13 target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32"
14 target triple = "i686--windows-msvc"
16 %struct.A = type { i32 }
18 define void @passes_two() #0 personality ptr @__CxxFrameHandler3 {
20 %argmem = alloca inalloca <{ %struct.A, %struct.A }>, align 4
21 %0 = getelementptr inbounds <{ %struct.A, %struct.A }>, ptr %argmem, i32 0, i32 1
22 %call = call x86_thiscallcc ptr @"\01??0A@@QAE@XZ"(ptr %0)
23 %1 = getelementptr inbounds <{ %struct.A, %struct.A }>, ptr %argmem, i32 0, i32 0
24 %call1 = invoke x86_thiscallcc ptr @"\01??0A@@QAE@XZ"(ptr %1)
25 to label %invoke.cont unwind label %ehcleanup
27 invoke.cont: ; preds = %entry
28 call void @takes_two(ptr inalloca(<{ %struct.A, %struct.A }>) nonnull %argmem)
31 ehcleanup: ; preds = %entry
32 %2 = cleanuppad within none []
33 call x86_thiscallcc void @"\01??1A@@QAE@XZ"(ptr %0) [ "funclet"(token %2) ]
34 cleanupret from %2 unwind to caller
39 ; CHECK: movl %esp, %ebp
40 ; CHECK: subl ${{[0-9]+}}, %esp
43 ; CHECK: calll "??0A@@QAE@XZ"
44 ; CHECK: calll "??0A@@QAE@XZ"
45 ; CHECK: calll _takes_two
46 ; ESP must be restored via EBP due to "dynamic" alloca.
47 ; CHECK: leal -{{[0-9]+}}(%ebp), %esp
51 ; CHECK: "?dtor$2@?0?passes_two@4HA":
53 ; CHECK: subl $8, %esp
54 ; CHECK: addl $12, %ebp
55 ; CHECK: {{movl|leal}} -{{[0-9]+}}(%ebp), %ecx
56 ; CHECK: calll "??1A@@QAE@XZ"
57 ; CHECK: addl $8, %esp
60 declare void @takes_two(ptr inalloca(<{ %struct.A, %struct.A }>)) #0
62 declare x86_thiscallcc ptr @"\01??0A@@QAE@XZ"(ptr returned) #0
64 declare i32 @__CxxFrameHandler3(...)
66 declare x86_thiscallcc void @"\01??1A@@QAE@XZ"(ptr) #0
68 attributes #0 = { "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }