diff options
author | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2017-02-23 21:06:35 +0000 |
---|---|---|
committer | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2017-02-23 21:06:35 +0000 |
commit | ee2d77f6d693b88a335f34d559d7f82fb6998859 (patch) | |
tree | 51e10ff4ef53d82da5fdd516b4ebd655a6599d15 /llvm/test | |
parent | ae9dadecf389d96023589f3ff145da4da6cba92b (diff) | |
download | bcm5719-llvm-ee2d77f6d693b88a335f34d559d7f82fb6998859.tar.gz bcm5719-llvm-ee2d77f6d693b88a335f34d559d7f82fb6998859.zip |
Disable TLS for stack protector on Android API<17.
The TLS slot did not exist back then.
llvm-svn: 296014
Diffstat (limited to 'llvm/test')
-rw-r--r-- | llvm/test/CodeGen/X86/stack-protector-target.ll | 40 | ||||
-rw-r--r-- | llvm/test/Transforms/SafeStack/X86/abi_ssp.ll | 18 |
2 files changed, 37 insertions, 21 deletions
diff --git a/llvm/test/CodeGen/X86/stack-protector-target.ll b/llvm/test/CodeGen/X86/stack-protector-target.ll index 66e45055b2b..fc5a18d79d4 100644 --- a/llvm/test/CodeGen/X86/stack-protector-target.ll +++ b/llvm/test/CodeGen/X86/stack-protector-target.ll @@ -1,10 +1,17 @@ ; 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 +; RUN: llc -mtriple=i386-linux < %s -o - | FileCheck --check-prefix=I386-TLS %s +; RUN: llc -mtriple=x86_64-linux < %s -o - | FileCheck --check-prefix=X64-TLS %s + +; RUN: llc -mtriple=i386-linux-android < %s -o - | FileCheck --check-prefix=I386 %s +; RUN: llc -mtriple=i386-linux-android16 < %s -o - | FileCheck --check-prefix=I386 %s +; RUN: llc -mtriple=i386-linux-android17 < %s -o - | FileCheck --check-prefix=I386-TLS %s +; RUN: llc -mtriple=i386-linux-android24 < %s -o - | FileCheck --check-prefix=I386-TLS %s +; RUN: llc -mtriple=x86_64-linux-android < %s -o - | FileCheck --check-prefix=X64-TLS %s +; RUN: llc -mtriple=x86_64-linux-android17 < %s -o - | FileCheck --check-prefix=X64-TLS %s +; RUN: llc -mtriple=x86_64-linux-android24 < %s -o - | FileCheck --check-prefix=X64-TLS %s + +; RUN: llc -mtriple=i386-kfreebsd < %s -o - | FileCheck --check-prefix=I386-TLS %s +; RUN: llc -mtriple=x86_64-kfreebsd < %s -o - | FileCheck --check-prefix=X64-TLS %s define void @_Z1fv() sspreq { entry: @@ -16,12 +23,17 @@ entry: 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]] +; X64-TLS: movq %fs:40, %[[B:.*]] +; X64-TLS: movq %[[B]], 16(%rsp) +; X64-TLS: movq %fs:40, %[[C:.*]] +; X64-TLS: cmpq 16(%rsp), %[[C]] + +; I386: movl __stack_chk_guard, %[[B:.*]] +; I386: movl %[[B]], 8(%esp) +; I386: movl __stack_chk_guard, %[[C:.*]] +; I386: cmpl 8(%esp), %[[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]] +; I386-TLS: movl %gs:20, %[[B:.*]] +; I386-TLS: movl %[[B]], 8(%esp) +; I386-TLS: movl %gs:20, %[[C:.*]] +; I386-TLS: cmpl 8(%esp), %[[C]] diff --git a/llvm/test/Transforms/SafeStack/X86/abi_ssp.ll b/llvm/test/Transforms/SafeStack/X86/abi_ssp.ll index ba4ced5b882..797dfd579dd 100644 --- a/llvm/test/Transforms/SafeStack/X86/abi_ssp.ll +++ b/llvm/test/Transforms/SafeStack/X86/abi_ssp.ll @@ -1,18 +1,22 @@ -; RUN: opt -safe-stack -S -mtriple=i686-pc-linux-gnu < %s -o - | FileCheck --check-prefix=TLS --check-prefix=TLS32 %s -; RUN: opt -safe-stack -S -mtriple=x86_64-pc-linux-gnu < %s -o - | FileCheck --check-prefix=TLS --check-prefix=TLS64 %s -; RUN: opt -safe-stack -S -mtriple=i686-linux-android < %s -o - | FileCheck --check-prefix=TLS --check-prefix=TLS32 %s -; RUN: opt -safe-stack -S -mtriple=x86_64-linux-android < %s -o - | FileCheck --check-prefix=TLS --check-prefix=TLS64 %s +; RUN: opt -safe-stack -S -mtriple=i686-pc-linux-gnu < %s -o - | FileCheck --check-prefixes=COMMON,TLS32 %s +; RUN: opt -safe-stack -S -mtriple=x86_64-pc-linux-gnu < %s -o - | FileCheck --check-prefixes=COMMON,TLS64 %s + +; RUN: opt -safe-stack -S -mtriple=i686-linux-android < %s -o - | FileCheck --check-prefixes=COMMON,GLOBAL32 %s +; RUN: opt -safe-stack -S -mtriple=i686-linux-android24 < %s -o - | FileCheck --check-prefixes=COMMON,TLS32 %s + +; RUN: opt -safe-stack -S -mtriple=x86_64-linux-android < %s -o - | FileCheck --check-prefixes=COMMON,TLS64 %s define void @foo() safestack sspreq { entry: ; TLS32: %[[StackGuard:.*]] = load i8*, i8* addrspace(256)* inttoptr (i32 20 to i8* addrspace(256)*) ; TLS64: %[[StackGuard:.*]] = load i8*, i8* addrspace(257)* inttoptr (i32 40 to i8* addrspace(257)*) -; TLS: store i8* %[[StackGuard]], i8** %[[StackGuardSlot:.*]] +; GLOBAL32: %[[StackGuard:.*]] = load i8*, i8** @__stack_chk_guard +; COMMON: store i8* %[[StackGuard]], i8** %[[StackGuardSlot:.*]] %a = alloca i8, align 1 call void @Capture(i8* %a) -; TLS: %[[A:.*]] = load i8*, i8** %[[StackGuardSlot]] -; TLS: icmp ne i8* %[[StackGuard]], %[[A]] +; COMMON: %[[A:.*]] = load i8*, i8** %[[StackGuardSlot]] +; COMMON: icmp ne i8* %[[StackGuard]], %[[A]] ret void } |