xref: /aosp_15_r20/external/llvm/test/CodeGen/ARM/cfi-alignment.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc -mtriple=thumbv7k-apple-watchos7.0 -o - %s | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker
3*9880d681SAndroid Build Coastguard Worker; Since d11 doesn't get pushed with the aligned registers, its frameindex
4*9880d681SAndroid Build Coastguard Worker; shouldn't be modified to say it has been.
5*9880d681SAndroid Build Coastguard Worker
6*9880d681SAndroid Build Coastguard Workerdefine void @foo() {
7*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: foo:
8*9880d681SAndroid Build Coastguard Worker; CHECK: push {r7, lr}
9*9880d681SAndroid Build Coastguard Worker; CHECK: .cfi_offset r7, -8
10*9880d681SAndroid Build Coastguard Worker; CHECK: vpush {d11}
11*9880d681SAndroid Build Coastguard Worker; CHECK: vpush {d8, d9}
12*9880d681SAndroid Build Coastguard Worker; CHECK: .cfi_offset d11, -16
13*9880d681SAndroid Build Coastguard Worker; CHECK: .cfi_offset d9, -24
14*9880d681SAndroid Build Coastguard Worker; CHECK: .cfi_offset d8, -32
15*9880d681SAndroid Build Coastguard Worker  call void asm sideeffect "", "~{d8},~{d9},~{d11}"()
16*9880d681SAndroid Build Coastguard Worker  call void @bar()
17*9880d681SAndroid Build Coastguard Worker  ret void
18*9880d681SAndroid Build Coastguard Worker}
19*9880d681SAndroid Build Coastguard Worker
20*9880d681SAndroid Build Coastguard Workerdefine void @variadic_foo(i8, ...) {
21*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: variadic_foo:
22*9880d681SAndroid Build Coastguard Worker; CHECK: sub sp, #12
23*9880d681SAndroid Build Coastguard Worker; CHECK: push {r7, lr}
24*9880d681SAndroid Build Coastguard Worker; CHECK: .cfi_offset r7, -20
25*9880d681SAndroid Build Coastguard Worker; CHECK: sub sp, #4
26*9880d681SAndroid Build Coastguard Worker; CHECK: vpush {d11}
27*9880d681SAndroid Build Coastguard Worker; CHECK: vpush {d8, d9}
28*9880d681SAndroid Build Coastguard Worker; CHECK: .cfi_offset d11, -32
29*9880d681SAndroid Build Coastguard Worker; CHECK: .cfi_offset d9, -40
30*9880d681SAndroid Build Coastguard Worker; CHECK: .cfi_offset d8, -48
31*9880d681SAndroid Build Coastguard Worker  call void asm sideeffect "", "~{d8},~{d9},~{d11}"()
32*9880d681SAndroid Build Coastguard Worker  call void @llvm.va_start(i8* null)
33*9880d681SAndroid Build Coastguard Worker  call void @bar()
34*9880d681SAndroid Build Coastguard Worker  ret void
35*9880d681SAndroid Build Coastguard Worker}
36*9880d681SAndroid Build Coastguard Worker
37*9880d681SAndroid Build Coastguard Workerdefine void @test_maintain_stack_align() {
38*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: test_maintain_stack_align:
39*9880d681SAndroid Build Coastguard Worker; CHECK: push {r7, lr}
40*9880d681SAndroid Build Coastguard Worker; CHECK: vpush {d8, d9}
41*9880d681SAndroid Build Coastguard Worker; CHECK: sub sp, #8
42*9880d681SAndroid Build Coastguard Worker  call void asm sideeffect "", "~{d8},~{d9}"()
43*9880d681SAndroid Build Coastguard Worker  call void @bar()
44*9880d681SAndroid Build Coastguard Worker  ret void
45*9880d681SAndroid Build Coastguard Worker}
46*9880d681SAndroid Build Coastguard Worker
47*9880d681SAndroid Build Coastguard Workerdeclare void @bar()
48*9880d681SAndroid Build Coastguard Workerdeclare void @llvm.va_start(i8*) nounwind
49