1 ; RUN: llc -mtriple=hexagon -mcpu=hexagonv55 -enable-stackovf-sanitizer < %s | FileCheck %s
4 ; CHECK: __runtime_stack_check
5 define i32 @foo_1(i32 %n) #0 {
7 %local = alloca [1024 x i32], align 8
8 call void @llvm.lifetime.start.p0(i64 4096, ptr %local) #1
9 call void @baz_1(ptr %local) #3
10 %arrayidx = getelementptr inbounds [1024 x i32], ptr %local, i32 0, i32 %n
11 %0 = load i32, ptr %arrayidx, align 4
12 call void @llvm.lifetime.end.p0(i64 4096, ptr %local) #1
17 ; CHECK: __save_r16_through_r19_stkchk
18 define i32 @foo_2(i32 %n, ptr %y) #0 {
20 %local = alloca [2048 x i32], align 8
21 call void @llvm.lifetime.start.p0(i64 8192, ptr %local) #1
22 call void @baz_2(ptr %y, ptr %local) #3
23 %0 = load i32, ptr %y, align 4
24 %add = add nsw i32 %n, %0
25 %arrayidx = getelementptr inbounds [2048 x i32], ptr %local, i32 0, i32 %add
26 %1 = load i32, ptr %arrayidx, align 4
27 call void @llvm.lifetime.end.p0(i64 8192, ptr %local) #1
31 declare void @baz_1(ptr) #2
32 declare void @baz_2(ptr, ptr) #2
33 declare void @llvm.lifetime.start.p0(i64, ptr nocapture) #1
34 declare void @llvm.lifetime.end.p0(i64, ptr nocapture) #1
36 attributes #0 = { nounwind optsize "less-precise-fpmad"="false" "frame-pointer"="all" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
37 attributes #1 = { nounwind }
38 attributes #2 = { optsize "less-precise-fpmad"="false" "frame-pointer"="all" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
39 attributes #3 = { optsize }