1 ; RUN: llc -mtriple=arm64-apple-ios -mattr=+reserve-x18 -o - %s | FileCheck %s --check-prefix=CHECK-RESERVE-X18
2 ; RUN: llc -mtriple=arm64-freebsd-gnu -mattr=+reserve-x18 -o - %s | FileCheck %s --check-prefix=CHECK-RESERVE-X18
3 ; RUN: llc -mtriple=arm64-linux-gnu -o - %s | FileCheck %s
4 ; RUN: llc -mtriple=aarch64-windows -o - %s | FileCheck %s --check-prefix=CHECK-RESERVE-X18
6 ; x18 is reserved as a platform register on Darwin but not on other
7 ; systems. Create loads of register pressure and make sure this is respected.
9 ; Also, fp must always refer to a valid frame record, even if it's not the one
10 ; of the current function, so it shouldn't be used either.
12 @var = global [30 x i64] zeroinitializer
14 define void @keep_live() {
15 %val = load volatile [30 x i64], [30 x i64]* @var
16 store volatile [30 x i64] %val, [30 x i64]* @var
21 ; CHECK-RESERVE-X18-NOT: ldr fp
22 ; CHECK-RESERVE-X18-NOT: ldr x18
23 ; CHECK-RESERVE-X18: Spill
24 ; CHECK-RESERVE-X18-NOT: ldr fp
25 ; CHECK-RESERVE-X18-NOT: ldr x18
26 ; CHECK-RESERVE-X18: ret