xref: /aosp_15_r20/external/llvm/test/CodeGen/X86/dynamic-alloca-in-entry.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; Allocas with unknown size in the entry block are dynamic.
4*9880d681SAndroid Build Coastguard Workerdefine void @foo(i32 %n) {
5*9880d681SAndroid Build Coastguard Worker  %m = alloca i32, i32 %n
6*9880d681SAndroid Build Coastguard Worker  ret void
7*9880d681SAndroid Build Coastguard Worker}
8*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: _foo:
9*9880d681SAndroid Build Coastguard Worker; CHECK: calll __chkstk
10*9880d681SAndroid Build Coastguard Worker; CHECK: retl
11*9880d681SAndroid Build Coastguard Worker
12*9880d681SAndroid Build Coastguard Worker; Use of inalloca implies that that the alloca is not static.
13*9880d681SAndroid Build Coastguard Workerdefine void @bar() {
14*9880d681SAndroid Build Coastguard Worker  %m = alloca inalloca i32
15*9880d681SAndroid Build Coastguard Worker  ret void
16*9880d681SAndroid Build Coastguard Worker}
17*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: _bar:
18*9880d681SAndroid Build Coastguard Worker; CHECK: pushl %eax
19*9880d681SAndroid Build Coastguard Worker; CHECK: retl
20