• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt -safe-stack -S -mtriple=aarch64-linux-android < %s -o - | FileCheck --check-prefix=TLS %s
2
3
4define void @foo() nounwind uwtable safestack sspreq {
5entry:
6; The first @llvm.thread.pointer is for the unsafe stack pointer, skip it.
7; TLS: call i8* @llvm.thread.pointer()
8
9; TLS: %[[TP2:.*]] = call i8* @llvm.thread.pointer()
10; TLS: %[[B:.*]] = getelementptr i8, i8* %[[TP2]], i32 40
11; TLS: %[[C:.*]] = bitcast i8* %[[B]] to i8**
12; TLS: %[[StackGuard:.*]] = load i8*, i8** %[[C]]
13; TLS: store i8* %[[StackGuard]], i8** %[[StackGuardSlot:.*]]
14  %a = alloca i128, align 16
15  call void @Capture(i128* %a)
16
17; TLS: %[[A:.*]] = load i8*, i8** %[[StackGuardSlot]]
18; TLS: icmp ne i8* %[[StackGuard]], %[[A]]
19  ret void
20}
21
22declare void @Capture(i128*)
23