2016-04-06 06:41:50 +08:00
|
|
|
; Test target-specific stack cookie location.
|
|
|
|
; RUN: llc -mtriple=aarch64-linux-android < %s -o - | FileCheck --check-prefix=ANDROID-AARCH64 %s
|
2017-04-05 03:51:53 +08:00
|
|
|
; RUN: llc -mtriple=aarch64-fuchsia < %s -o - | FileCheck --check-prefixes=FUCHSIA-AARCH64-COMMON,FUCHSIA-AARCH64-USER %s
|
|
|
|
; RUN: llc -mtriple=aarch64-fuchsia -code-model=kernel < %s -o - | FileCheck --check-prefixes=FUCHSIA-AARCH64-COMMON,FUCHSIA-AARCH64-KERNEL %s
|
2018-11-09 10:48:36 +08:00
|
|
|
; RUN: llc -mtriple=aarch64-windows < %s -o - | FileCheck --check-prefix=WINDOWS-AARCH64 %s
|
2016-04-06 06:41:50 +08:00
|
|
|
|
|
|
|
define void @_Z1fv() sspreq {
|
|
|
|
entry:
|
|
|
|
%x = alloca i32, align 4
|
|
|
|
%0 = bitcast i32* %x to i8*
|
|
|
|
call void @_Z7CapturePi(i32* nonnull %x)
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
declare void @_Z7CapturePi(i32*)
|
|
|
|
|
|
|
|
; ANDROID-AARCH64: mrs [[A:.*]], TPIDR_EL0
|
|
|
|
; ANDROID-AARCH64: ldr [[B:.*]], {{\[}}[[A]], #40]
|
|
|
|
; ANDROID-AARCH64: str [[B]], [sp,
|
|
|
|
; ANDROID-AARCH64: ldr [[C:.*]], {{\[}}[[A]], #40]
|
|
|
|
; ANDROID-AARCH64: ldr [[D:.*]], [sp,
|
|
|
|
; ANDROID-AARCH64: cmp [[C]], [[D]]
|
2017-02-24 11:10:10 +08:00
|
|
|
|
2017-04-05 03:51:53 +08:00
|
|
|
; FUCHSIA-AARCH64-USER: mrs [[A:.*]], TPIDR_EL0
|
|
|
|
; FUCHSIA-AARCH64-KERNEL: mrs [[A:.*]], TPIDR_EL1
|
|
|
|
; FUCHSIA-AARCH64-COMMON: ldur [[B:.*]], {{\[}}[[A]], #-16]
|
|
|
|
; FUCHSIA-AARCH64-COMMON: str [[B]], [sp,
|
|
|
|
; FUCHSIA-AARCH64-COMMON: ldur [[C:.*]], {{\[}}[[A]], #-16]
|
|
|
|
; FUCHSIA-AARCH64-COMMON: ldr [[D:.*]], [sp,
|
|
|
|
; FUCHSIA-AARCH64-COMMON: cmp [[C]], [[D]]
|
2018-11-09 10:48:36 +08:00
|
|
|
|
|
|
|
; WINDOWS-AARCH64: adrp x8, __security_cookie
|
|
|
|
; WINDOWS-AARCH64: ldr x8, [x8, __security_cookie]
|
|
|
|
; WINDOWS-AARCH64: str x8, [sp, #8]
|
|
|
|
; WINDOWS-AARCH64: bl _Z7CapturePi
|
|
|
|
; WINDOWS-AARCH64: ldr x0, [sp, #8]
|
|
|
|
; WINDOWS-AARCH64: bl __security_check_cookie
|