1 ; RUN: llc -mtriple x86_64-apple-macosx10.8.0 < %s 2>&1 >/dev/null | FileCheck %s
2 ; Check the internal option that warns when the stack frame size exceeds the
7 define void @nowarn() nounwind ssp "warn-stack-size"="80" {
9 %buffer = alloca [12 x i8], align 1
10 call void @doit(ptr %buffer) nounwind
14 ; CHECK: warning: <unknown>:0:0: stack frame size ([[STCK:[0-9]+]]) exceeds limit (80) in function 'warn'
15 define void @warn() nounwind ssp "warn-stack-size"="80" {
17 %buffer = alloca [80 x i8], align 1
18 call void @doit(ptr %buffer) nounwind
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 the
24 ; combined stack size of the machine stack and unsafe stack will exceed the
27 ; CHECK: warning: <unknown>:0:0: stack frame size ([[STCK:[0-9]+]]) exceeds limit (80) in function 'warn_safestack'
28 define i32 @warn_safestack() nounwind ssp safestack "warn-stack-size"="80" {
30 %var = alloca i32, align 4
31 %buffer = alloca [80 x i8], align 1
32 call void @doit(ptr %buffer) nounwind
33 call void @doit(ptr %var) nounwind
34 %val = load i32, ptr %var
37 declare void @doit(ptr)