2015-09-24 02:07:56 +08:00
|
|
|
; RUN: opt -safe-stack -S -mtriple=aarch64-linux-android < %s -o - | FileCheck %s
|
|
|
|
|
|
|
|
|
|
|
|
define void @foo() nounwind uwtable safestack {
|
|
|
|
entry:
|
2016-04-20 04:51:05 +08:00
|
|
|
; CHECK: %[[TP:.*]] = call i8* @llvm.thread.pointer()
|
2015-10-27 02:28:25 +08:00
|
|
|
; CHECK: %[[SPA0:.*]] = getelementptr i8, i8* %[[TP]], i32 72
|
|
|
|
; CHECK: %[[SPA:.*]] = bitcast i8* %[[SPA0]] to i8**
|
2015-09-24 02:07:56 +08:00
|
|
|
; CHECK: %[[USP:.*]] = load i8*, i8** %[[SPA]]
|
|
|
|
; CHECK: %[[USST:.*]] = getelementptr i8, i8* %[[USP]], i32 -16
|
|
|
|
; CHECK: store i8* %[[USST]], i8** %[[SPA]]
|
|
|
|
|
|
|
|
%a = alloca i8, align 8
|
|
|
|
call void @Capture(i8* %a)
|
|
|
|
|
|
|
|
; CHECK: store i8* %[[USP]], i8** %[[SPA]]
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
declare void @Capture(i8*)
|