Skip to content

Commit

Permalink
Start reserving x18 by default on Android targets.
Browse files Browse the repository at this point in the history
Differential Revision: https://reviews.llvm.org/D45588

llvm-svn: 340889
  • Loading branch information
pcc committed Aug 29, 2018
1 parent d919890 commit 9c9c8b2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions clang/test/Driver/sanitizer-ld.c
Expand Up @@ -575,6 +575,9 @@
// RUN: %clang -fsanitize=shadow-call-stack %s -### -o %t.o 2>&1 \
// RUN: -target arm64-unknown-ios -fuse-ld=ld \
// RUN: | FileCheck --check-prefix=CHECK-SHADOWCALLSTACK-LINUX-AARCH64-X18 %s
// RUN: %clang -fsanitize=shadow-call-stack %s -### -o %t.o 2>&1 \
// RUN: -target aarch64-unknown-linux-android -fuse-ld=ld \
// RUN: | FileCheck --check-prefix=CHECK-SHADOWCALLSTACK-LINUX-AARCH64-X18 %s
// CHECK-SHADOWCALLSTACK-LINUX-AARCH64-X18-NOT: error:

// RUN: %clang -fsanitize=shadow-call-stack %s -### -o %t.o 2>&1 \
Expand Down
3 changes: 2 additions & 1 deletion llvm/lib/Support/TargetParser.cpp
Expand Up @@ -943,7 +943,8 @@ unsigned llvm::AArch64::parseArchVersion(StringRef Arch) {
}

bool llvm::AArch64::isX18ReservedByDefault(const Triple &TT) {
return TT.isOSDarwin() || TT.isOSFuchsia() || TT.isOSWindows();
return TT.isAndroid() || TT.isOSDarwin() || TT.isOSFuchsia() ||
TT.isOSWindows();
}

struct GPUInfo {
Expand Down
1 change: 1 addition & 0 deletions llvm/test/CodeGen/AArch64/arm64-platform-reg.ll
Expand Up @@ -3,6 +3,7 @@
; RUN: llc -mtriple=aarch64-fuchsia -mattr=+reserve-x20 -o - %s | FileCheck %s --check-prefix=CHECK-RESERVE --check-prefix=CHECK-RESERVE-X20
; RUN: llc -mtriple=aarch64-fuchsia -mattr=+reserve-x18,+reserve-x20 -o - %s | FileCheck %s --check-prefix=CHECK-RESERVE --check-prefix=CHECK-RESERVE-X18 --check-prefix=CHECK-RESERVE-X20
; RUN: llc -mtriple=arm64-linux-gnu -o - %s | FileCheck %s
; RUN: llc -mtriple=aarch64-linux-android -o - %s | FileCheck %s --check-prefix=CHECK-RESERVE --check-prefix=CHECK-RESERVE-X18
; RUN: llc -mtriple=aarch64-fuchsia -o - %s | FileCheck %s --check-prefix=CHECK-RESERVE --check-prefix=CHECK-RESERVE-X18
; RUN: llc -mtriple=aarch64-windows -o - %s | FileCheck %s --check-prefix=CHECK-RESERVE --check-prefix=CHECK-RESERVE-X18

Expand Down

0 comments on commit 9c9c8b2

Please sign in to comment.