diff options
Diffstat (limited to 'test/CodeGen/AArch64/arm64-platform-reg.ll')
-rw-r--r-- | test/CodeGen/AArch64/arm64-platform-reg.ll | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/test/CodeGen/AArch64/arm64-platform-reg.ll b/test/CodeGen/AArch64/arm64-platform-reg.ll index 145066e697f..ccd747f481a 100644 --- a/test/CodeGen/AArch64/arm64-platform-reg.ll +++ b/test/CodeGen/AArch64/arm64-platform-reg.ll @@ -6,6 +6,49 @@ ; 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 +; Test reserve-x# options individually. +; RUN: llc -mtriple=arm64-linux-gnu -mattr=+reserve-x1 -o - %s | FileCheck %s --check-prefixes=CHECK-RESERVE,CHECK-RESERVE-X1 +; RUN: llc -mtriple=arm64-linux-gnu -mattr=+reserve-x2 -o - %s | FileCheck %s --check-prefixes=CHECK-RESERVE,CHECK-RESERVE-X2 +; RUN: llc -mtriple=arm64-linux-gnu -mattr=+reserve-x3 -o - %s | FileCheck %s --check-prefixes=CHECK-RESERVE,CHECK-RESERVE-X3 +; RUN: llc -mtriple=arm64-linux-gnu -mattr=+reserve-x4 -o - %s | FileCheck %s --check-prefixes=CHECK-RESERVE,CHECK-RESERVE-X4 +; RUN: llc -mtriple=arm64-linux-gnu -mattr=+reserve-x5 -o - %s | FileCheck %s --check-prefixes=CHECK-RESERVE,CHECK-RESERVE-X5 +; RUN: llc -mtriple=arm64-linux-gnu -mattr=+reserve-x6 -o - %s | FileCheck %s --check-prefixes=CHECK-RESERVE,CHECK-RESERVE-X6 +; RUN: llc -mtriple=arm64-linux-gnu -mattr=+reserve-x7 -o - %s | FileCheck %s --check-prefixes=CHECK-RESERVE,CHECK-RESERVE-X7 + +; Test multiple of reserve-x# options together. +; RUN: llc -mtriple=arm64-linux-gnu \ +; RUN: -mattr=+reserve-x1 \ +; RUN: -mattr=+reserve-x2 \ +; RUN: -mattr=+reserve-x18 \ +; RUN: -o - %s | FileCheck %s \ +; RUN: --check-prefix=CHECK-RESERVE \ +; RUN: --check-prefix=CHECK-RESERVE-X1 \ +; RUN: --check-prefix=CHECK-RESERVE-X2 \ +; RUN: --check-prefix=CHECK-RESERVE-X18 + +; Test all reserve-x# options together. +; RUN: llc -mtriple=arm64-linux-gnu \ +; RUN: -mattr=+reserve-x1 \ +; RUN: -mattr=+reserve-x2 \ +; RUN: -mattr=+reserve-x3 \ +; RUN: -mattr=+reserve-x4 \ +; RUN: -mattr=+reserve-x5 \ +; RUN: -mattr=+reserve-x6 \ +; RUN: -mattr=+reserve-x7 \ +; RUN: -mattr=+reserve-x18 \ +; RUN: -mattr=+reserve-x20 \ +; RUN: -o - %s | FileCheck %s \ +; RUN: --check-prefix=CHECK-RESERVE \ +; RUN: --check-prefix=CHECK-RESERVE-X1 \ +; RUN: --check-prefix=CHECK-RESERVE-X2 \ +; RUN: --check-prefix=CHECK-RESERVE-X3 \ +; RUN: --check-prefix=CHECK-RESERVE-X4 \ +; RUN: --check-prefix=CHECK-RESERVE-X5 \ +; RUN: --check-prefix=CHECK-RESERVE-X6 \ +; RUN: --check-prefix=CHECK-RESERVE-X7 \ +; RUN: --check-prefix=CHECK-RESERVE-X18 \ +; RUN: --check-prefix=CHECK-RESERVE-X20 + ; x18 is reserved as a platform register on Darwin but not on other ; systems. Create loads of register pressure and make sure this is respected. @@ -22,10 +65,24 @@ define void @keep_live() { ; CHECK: str x18 ; CHECK-RESERVE-NOT: ldr fp +; CHECK-RESERVE-X1-NOT: ldr x1, +; CHECK-RESERVE-X2-NOT: ldr x2, +; CHECK-RESERVE-X3-NOT: ldr x3, +; CHECK-RESERVE-X4-NOT: ldr x4, +; CHECK-RESERVE-X5-NOT: ldr x5, +; CHECK-RESERVE-X6-NOT: ldr x6, +; CHECK-RESERVE-X7-NOT: ldr x7, ; CHECK-RESERVE-X18-NOT: ldr x18 ; CHECK-RESERVE-X20-NOT: ldr x20 ; CHECK-RESERVE: Spill ; CHECK-RESERVE-NOT: ldr fp +; CHECK-RESERVE-X1-NOT: ldr x1, +; CHECK-RESERVE-X2-NOT: ldr x2, +; CHECK-RESERVE-X3-NOT: ldr x3, +; CHECK-RESERVE-X4-NOT: ldr x4, +; CHECK-RESERVE-X5-NOT: ldr x5, +; CHECK-RESERVE-X6-NOT: ldr x6, +; CHECK-RESERVE-X7-NOT: ldr x7, ; CHECK-RESERVE-X18-NOT: ldr x18 ; CHECK-RESERVE-X20-NOT: ldr x20 ; CHECK-RESERVE: ret |