1 ; RUN: llc < %s -mtriple=i686-pc-win32 | FileCheck %s 2 3 %Foo = type { i32, i32 } 4 5 declare void @f(%Foo* inalloca %b) 6 7 define void @a() { 8 ; CHECK-LABEL: _a: 9 entry: 10 %b = alloca inalloca %Foo 11 ; CHECK: movl $8, %eax 12 ; CHECK: calll __chkstk 13 %f1 = getelementptr %Foo, %Foo* %b, i32 0, i32 0 14 %f2 = getelementptr %Foo, %Foo* %b, i32 0, i32 1 15 store i32 13, i32* %f1 16 store i32 42, i32* %f2 17 ; CHECK: movl %esp, %eax 18 ; CHECK: movl $13, (%eax) 19 ; CHECK: movl $42, 4(%eax) 20 call void @f(%Foo* inalloca %b) 21 ; CHECK: calll _f 22 ret void 23 } 24 25 declare void @inreg_with_inalloca(i32 inreg %a, %Foo* inalloca %b) 26 27 define void @b() { 28 ; CHECK-LABEL: _b: 29 entry: 30 %b = alloca inalloca %Foo 31 ; CHECK: movl $8, %eax 32 ; CHECK: calll __chkstk 33 %f1 = getelementptr %Foo, %Foo* %b, i32 0, i32 0 34 %f2 = getelementptr %Foo, %Foo* %b, i32 0, i32 1 35 store i32 13, i32* %f1 36 store i32 42, i32* %f2 37 ; CHECK: movl %esp, %eax 38 ; CHECK: movl $13, (%eax) 39 ; CHECK: movl $42, 4(%eax) 40 call void @inreg_with_inalloca(i32 inreg 1, %Foo* inalloca %b) 41 ; CHECK: movl $1, %eax 42 ; CHECK: calll _inreg_with_inalloca 43 ret void 44 } 45 46 declare x86_thiscallcc void @thiscall_with_inalloca(i8* %a, %Foo* inalloca %b) 47 48 define void @c() { 49 ; CHECK-LABEL: _c: 50 entry: 51 %b = alloca inalloca %Foo 52 ; CHECK: movl $8, %eax 53 ; CHECK: calll __chkstk 54 %f1 = getelementptr %Foo, %Foo* %b, i32 0, i32 0 55 %f2 = getelementptr %Foo, %Foo* %b, i32 0, i32 1 56 store i32 13, i32* %f1 57 store i32 42, i32* %f2 58 ; CHECK: movl %esp, %eax 59 ; CHECK-DAG: movl $13, (%eax) 60 ; CHECK-DAG: movl $42, 4(%eax) 61 call x86_thiscallcc void @thiscall_with_inalloca(i8* null, %Foo* inalloca %b) 62 ; CHECK-DAG: xorl %ecx, %ecx 63 ; CHECK: calll _thiscall_with_inalloca 64 ret void 65 } 66