summaryrefslogtreecommitdiff
path: root/test/CodeGen/X86/inalloca-stdcall.ll
blob: e5f6ea70e9cb4c8b141b6d0ccc55de361fb3cdbc (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
; RUN: llc < %s -mtriple=i686-pc-win32 | FileCheck %s

%Foo = type { i32, i32 }

declare x86_stdcallcc void @f(%Foo* inalloca %a)
declare x86_stdcallcc void @i(i32 %a)

define void @g() {
; CHECK-LABEL: _g:
  %b = alloca inalloca %Foo
; CHECK: movl    $8, %eax
; CHECK: calll   __chkstk
  %f1 = getelementptr %Foo, %Foo* %b, i32 0, i32 0
  %f2 = getelementptr %Foo, %Foo* %b, i32 0, i32 1
  store i32 13, i32* %f1
  store i32 42, i32* %f2
; CHECK: movl    $13, (%esp)
; CHECK: movl    $42, 4(%esp)
  call x86_stdcallcc void @f(%Foo* inalloca %b)
; CHECK: calll   _f@8
; CHECK-NOT: %esp
; CHECK: pushl
; CHECK: calll   _i@4
  call x86_stdcallcc void @i(i32 0)
  ret void
}