aboutsummaryrefslogtreecommitdiffstats
path: root/test/CodeGen/X86/inalloca-ctor.ll
blob: eba4e72f9330e413e247f52f34d8ef3ff5b3baf6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
; RUN: llc < %s -mtriple=i686-pc-win32 | FileCheck %s

%Foo = type { i32, i32 }

%frame = type { %Foo, i32, %Foo }

declare void @f(%frame* inalloca %a)

declare void @Foo_ctor(%Foo* %this)

define void @g() {
entry:
  %args = alloca inalloca %frame
  %c = getelementptr %frame, %frame* %args, i32 0, i32 2
; CHECK: movl    $20, %eax
; CHECK: calll   __chkstk
; CHECK: movl %esp,
  call void @Foo_ctor(%Foo* %c)
; CHECK: leal 12(%{{.*}}),
; CHECK-NEXT: pushl
; CHECK-NEXT: calll _Foo_ctor
; CHECK: addl $4, %esp
  %b = getelementptr %frame, %frame* %args, i32 0, i32 1
  store i32 42, i32* %b
; CHECK: movl $42,
  %a = getelementptr %frame, %frame* %args, i32 0, i32 0
  call void @Foo_ctor(%Foo* %a)
; CHECK-NEXT: pushl
; CHECK-NEXT: calll _Foo_ctor
; CHECK: addl $4, %esp
  call void @f(%frame* inalloca %args)
; CHECK: calll   _f
  ret void
}