1 ; Test that storage for allocas with disjoint lifetimes is reused with
4 ; RUN: opt -S -passes=hwasan %s -hwasan-use-after-scope -o - | llc -no-stack-coloring=false -o - | FileCheck %s --check-prefix=COLOR
5 ; RUN: opt -S -passes=hwasan -hwasan-use-after-scope %s -o - | llc -no-stack-coloring=true -o - | FileCheck %s --check-prefix=NOCOLOR
7 target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
8 target triple = "aarch64-unknown-linux-android29"
10 ; REQUIRES: aarch64-registered-target
12 ; COLOR: sub sp, sp, #240
13 ; NOCOLOR: sub sp, sp, #384
15 define i32 @myCall_w2(i32 %in) sanitize_hwaddress {
17 %a = alloca [17 x ptr], align 8
18 %a2 = alloca [16 x ptr], align 8
19 call void @llvm.lifetime.start.p0(i64 136, ptr %a)
20 %t1 = call i32 @foo(i32 %in, ptr %a)
21 %t2 = call i32 @foo(i32 %in, ptr %a)
22 call void @llvm.lifetime.end.p0(i64 136, ptr %a)
23 call void @llvm.lifetime.start.p0(i64 128, ptr %a2)
24 %t3 = call i32 @foo(i32 %in, ptr %a2)
25 %t4 = call i32 @foo(i32 %in, ptr %a2)
26 call void @llvm.lifetime.end.p0(i64 128, ptr %a2)
27 %t5 = add i32 %t1, %t2
28 %t6 = add i32 %t3, %t4
29 %t7 = add i32 %t5, %t6
33 declare void @llvm.lifetime.start.p0(i64, ptr nocapture) nounwind
35 declare void @llvm.lifetime.end.p0(i64, ptr nocapture) nounwind
37 declare i32 @foo(i32, ptr)