xref: /aosp_15_r20/external/llvm/test/CodeGen/ARM/warn-stack.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc -mtriple thumbv7-apple-ios3.0.0 -warn-stack-size=80 < %s 2>&1 >/dev/null | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker; Check the internal option that warns when the stack size exceeds the
3*9880d681SAndroid Build Coastguard Worker; given amount.
4*9880d681SAndroid Build Coastguard Worker; <rdar://13987214>
5*9880d681SAndroid Build Coastguard Worker
6*9880d681SAndroid Build Coastguard Worker; CHECK-NOT: nowarn
7*9880d681SAndroid Build Coastguard Workerdefine void @nowarn() nounwind ssp {
8*9880d681SAndroid Build Coastguard Workerentry:
9*9880d681SAndroid Build Coastguard Worker  %buffer = alloca [12 x i8], align 1
10*9880d681SAndroid Build Coastguard Worker  %arraydecay = getelementptr inbounds [12 x i8], [12 x i8]* %buffer, i64 0, i64 0
11*9880d681SAndroid Build Coastguard Worker  call void @doit(i8* %arraydecay) nounwind
12*9880d681SAndroid Build Coastguard Worker  ret void
13*9880d681SAndroid Build Coastguard Worker}
14*9880d681SAndroid Build Coastguard Worker
15*9880d681SAndroid Build Coastguard Worker; CHECK: warning: stack size limit exceeded (92) in warn
16*9880d681SAndroid Build Coastguard Workerdefine void @warn() nounwind ssp {
17*9880d681SAndroid Build Coastguard Workerentry:
18*9880d681SAndroid Build Coastguard Worker  %buffer = alloca [80 x i8], align 1
19*9880d681SAndroid Build Coastguard Worker  %arraydecay = getelementptr inbounds [80 x i8], [80 x i8]* %buffer, i64 0, i64 0
20*9880d681SAndroid Build Coastguard Worker  call void @doit(i8* %arraydecay) nounwind
21*9880d681SAndroid Build Coastguard Worker  ret void
22*9880d681SAndroid Build Coastguard Worker}
23*9880d681SAndroid Build Coastguard Worker
24*9880d681SAndroid Build Coastguard Workerdeclare void @doit(i8*)
25