llvm/test/CodeGen/X86/stack-protector-target.ll
Marcin Koscielnicki d11ea2f4ad [X86] Extend some Linux special cases to cover kFreeBSD.
Both Linux and kFreeBSD use glibc, so follow similiar code paths.
Add isTargetGlibc to check for this, and use it instead of isTargetLinux
in a few places.

Fixes PR22248 for kFreeBSD.

Differential Revision: http://reviews.llvm.org/D19104

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268624 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-05 11:35:51 +00:00

28 lines
1.0 KiB
LLVM

; Test target-specific stack cookie location.
; RUN: llc -mtriple=i386-linux < %s -o - | FileCheck --check-prefix=LINUX-I386 %s
; RUN: llc -mtriple=x86_64-linux < %s -o - | FileCheck --check-prefix=LINUX-X64 %s
; RUN: llc -mtriple=i386-linux-android < %s -o - | FileCheck --check-prefix=LINUX-I386 %s
; RUN: llc -mtriple=x86_64-linux-android < %s -o - | FileCheck --check-prefix=LINUX-X64 %s
; RUN: llc -mtriple=i386-kfreebsd < %s -o - | FileCheck --check-prefix=LINUX-I386 %s
; RUN: llc -mtriple=x86_64-kfreebsd < %s -o - | FileCheck --check-prefix=LINUX-X64 %s
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*)
; LINUX-X64: movq %fs:40, %[[B:.*]]
; LINUX-X64: movq %[[B]], 16(%rsp)
; LINUX-X64: movq %fs:40, %[[C:.*]]
; LINUX-X64: cmpq 16(%rsp), %[[C]]
; LINUX-I386: movl %gs:20, %[[B:.*]]
; LINUX-I386: movl %[[B]], 8(%esp)
; LINUX-I386: movl %gs:20, %[[C:.*]]
; LINUX-I386: cmpl 8(%esp), %[[C]]