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