brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.3 KiB · 5558683 Raw
38 lines · plain
1; RUN: llc -mtriple x86_64-apple-macosx10.8.0 < %s 2>&1 >/dev/null | FileCheck %s2; Check the internal option that warns when the stack frame size exceeds the3; given amount.4; <rdar://13987214>5 6; CHECK-NOT: nowarn7define void @nowarn() nounwind ssp "warn-stack-size"="80" {8entry:9  %buffer = alloca [12 x i8], align 110  call void @doit(ptr %buffer) nounwind11  ret void12}13 14; CHECK: warning: <unknown>:0:0: stack frame size ([[STCK:[0-9]+]]) exceeds limit (80) in function 'warn'15define void @warn() nounwind ssp "warn-stack-size"="80" {16entry:17  %buffer = alloca [80 x i8], align 118  call void @doit(ptr %buffer) nounwind19  ret void20}21 22; Ensure that warn-stack-size also considers the size of the unsafe stack.23; With safestack enabled the machine stack size is well below 80, but the24; combined stack size of the machine stack and unsafe stack will exceed the25; warning threshold26 27; CHECK: warning: <unknown>:0:0: stack frame size ([[STCK:[0-9]+]]) exceeds limit (80) in function 'warn_safestack'28define i32 @warn_safestack() nounwind ssp safestack "warn-stack-size"="80" {29entry:30  %var = alloca i32, align 431  %buffer = alloca [80 x i8], align 132  call void @doit(ptr %buffer) nounwind33  call void @doit(ptr %var) nounwind34  %val = load i32, ptr %var35  ret i32 %val36}37declare void @doit(ptr)38