1 ; RUN: opt -safe-stack -safe-stack-coloring -S -mtriple=aarch64-linux-android < %s -o - | FileCheck %s
2 ; RUN: opt -passes=safe-stack -safe-stack-coloring -S -mtriple=aarch64-linux-android < %s -o - | FileCheck %s
4 define void @foo() nounwind uwtable safestack {
6 ; CHECK: %[[TP:.*]] = call ptr @llvm.thread.pointer()
7 ; CHECK: %[[SPA0:.*]] = getelementptr i8, ptr %[[TP]], i32 72
8 ; CHECK: %[[USP:.*]] = load ptr, ptr %[[SPA0]]
9 ; CHECK: %[[USST:.*]] = getelementptr i8, ptr %[[USP]], i32 -16
10 ; CHECK: store ptr %[[USST]], ptr %[[SPA0]]
12 %a = alloca i8, align 8
19 call void @Capture(ptr %a)
23 declare void @Capture(ptr)