Quentin Colombet | 249cb67 | 2013-06-08 00:07:54 +0000 | [diff] [blame] | 1 | ; RUN: llc -mtriple thumbv7-apple-ios3.0.0 -warn-stack-size=80 < %s 2>&1 >/dev/null | FileCheck %s |
| 2 | ; Check the internal option that warns when the stack size exceeds the |
| 3 | ; given amount. |
| 4 | ; <rdar://13987214> |
| 5 | |
| 6 | ; CHECK-NOT: nowarn |
| 7 | define void @nowarn() nounwind ssp { |
| 8 | entry: |
| 9 | %buffer = alloca [12 x i8], align 1 |
David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame] | 10 | %arraydecay = getelementptr inbounds [12 x i8], [12 x i8]* %buffer, i64 0, i64 0 |
Quentin Colombet | 249cb67 | 2013-06-08 00:07:54 +0000 | [diff] [blame] | 11 | call void @doit(i8* %arraydecay) nounwind |
| 12 | ret void |
| 13 | } |
| 14 | |
Quentin Colombet | b4c44d2 | 2013-12-17 17:47:22 +0000 | [diff] [blame] | 15 | ; CHECK: warning: stack size limit exceeded (96) in warn |
Quentin Colombet | 249cb67 | 2013-06-08 00:07:54 +0000 | [diff] [blame] | 16 | define void @warn() nounwind ssp { |
| 17 | entry: |
| 18 | %buffer = alloca [80 x i8], align 1 |
David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame] | 19 | %arraydecay = getelementptr inbounds [80 x i8], [80 x i8]* %buffer, i64 0, i64 0 |
Quentin Colombet | 249cb67 | 2013-06-08 00:07:54 +0000 | [diff] [blame] | 20 | call void @doit(i8* %arraydecay) nounwind |
| 21 | ret void |
| 22 | } |
| 23 | |
| 24 | declare void @doit(i8*) |