xref: /aosp_15_r20/external/llvm/test/CodeGen/X86/inalloca-stdcall.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -mtriple=i686-pc-win32 | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker
3*9880d681SAndroid Build Coastguard Worker%Foo = type { i32, i32 }
4*9880d681SAndroid Build Coastguard Worker
5*9880d681SAndroid Build Coastguard Workerdeclare x86_stdcallcc void @f(%Foo* inalloca %a)
6*9880d681SAndroid Build Coastguard Workerdeclare x86_stdcallcc void @i(i32 %a)
7*9880d681SAndroid Build Coastguard Worker
8*9880d681SAndroid Build Coastguard Workerdefine void @g() {
9*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: _g:
10*9880d681SAndroid Build Coastguard Worker  %b = alloca inalloca %Foo
11*9880d681SAndroid Build Coastguard Worker; CHECK: pushl   %eax
12*9880d681SAndroid Build Coastguard Worker; CHECK: pushl   %eax
13*9880d681SAndroid Build Coastguard Worker  %f1 = getelementptr %Foo, %Foo* %b, i32 0, i32 0
14*9880d681SAndroid Build Coastguard Worker  %f2 = getelementptr %Foo, %Foo* %b, i32 0, i32 1
15*9880d681SAndroid Build Coastguard Worker  store i32 13, i32* %f1
16*9880d681SAndroid Build Coastguard Worker  store i32 42, i32* %f2
17*9880d681SAndroid Build Coastguard Worker; CHECK: movl %esp, %eax
18*9880d681SAndroid Build Coastguard Worker; CHECK: movl    $13, (%eax)
19*9880d681SAndroid Build Coastguard Worker; CHECK: movl    $42, 4(%eax)
20*9880d681SAndroid Build Coastguard Worker  call x86_stdcallcc void @f(%Foo* inalloca %b)
21*9880d681SAndroid Build Coastguard Worker; CHECK: calll   _f@8
22*9880d681SAndroid Build Coastguard Worker; CHECK-NOT: %esp
23*9880d681SAndroid Build Coastguard Worker; CHECK: pushl
24*9880d681SAndroid Build Coastguard Worker; CHECK: calll   _i@4
25*9880d681SAndroid Build Coastguard Worker  call x86_stdcallcc void @i(i32 0)
26*9880d681SAndroid Build Coastguard Worker  ret void
27*9880d681SAndroid Build Coastguard Worker}
28