38 lines · plain
1; Test that storage for allocas with disjoint lifetimes is reused with2; use-after-scope.3 4; RUN: opt -S -passes=hwasan %s -hwasan-use-after-scope -o - | llc -no-stack-coloring=false -o - | FileCheck %s --check-prefix=COLOR5; RUN: opt -S -passes=hwasan -hwasan-use-after-scope %s -o - | llc -no-stack-coloring=true -o - | FileCheck %s --check-prefix=NOCOLOR6 7target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"8target triple = "aarch64-unknown-linux-android29"9 10; REQUIRES: aarch64-registered-target11 12; COLOR: sub sp, sp, #24013; NOCOLOR: sub sp, sp, #38414 15define i32 @myCall_w2(i32 %in) sanitize_hwaddress {16entry:17 %a = alloca [17 x ptr], align 818 %a2 = alloca [16 x ptr], align 819 call void @llvm.lifetime.start.p0(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(ptr %a)23 call void @llvm.lifetime.start.p0(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(ptr %a2)27 %t5 = add i32 %t1, %t228 %t6 = add i32 %t3, %t429 %t7 = add i32 %t5, %t630 ret i32 %t731}32 33declare void @llvm.lifetime.start.p0(ptr nocapture) nounwind34 35declare void @llvm.lifetime.end.p0(ptr nocapture) nounwind36 37declare i32 @foo(i32, ptr)38