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