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