2014-02-01 07:50:57 +08:00
|
|
|
; 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:
|
2014-03-09 14:41:58 +08:00
|
|
|
%args = alloca inalloca %frame
|
2014-02-01 07:50:57 +08:00
|
|
|
%c = getelementptr %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(%{{.*}}),
|
2014-12-09 14:10:44 +08:00
|
|
|
; CHECK-NEXT: pushl
|
|
|
|
; CHECK-NEXT: calll _Foo_ctor
|
2014-02-01 07:50:57 +08:00
|
|
|
; CHECK: addl $4, %esp
|
|
|
|
%b = getelementptr %frame* %args, i32 0, i32 1
|
|
|
|
store i32 42, i32* %b
|
|
|
|
; CHECK: movl $42,
|
|
|
|
%a = getelementptr %frame* %args, i32 0, i32 0
|
|
|
|
call void @Foo_ctor(%Foo* %a)
|
2014-12-09 14:10:44 +08:00
|
|
|
; CHECK-NEXT: pushl
|
|
|
|
; CHECK-NEXT: calll _Foo_ctor
|
2014-02-01 07:50:57 +08:00
|
|
|
; CHECK: addl $4, %esp
|
|
|
|
call void @f(%frame* inalloca %args)
|
|
|
|
; CHECK: calll _f
|
|
|
|
ret void
|
|
|
|
}
|