xref: /llvm-project/llvm/test/CodeGen/ARM/fp16-frame-lowering.ll (revision bed1c7f061aa12417aa081e334afdba45767b938)
1; RUN: llc < %s -mtriple armv8a--none-eabi -mattr=+fullfp16             | FileCheck %s
2; RUN: llc < %s -mtriple armv8a--none-eabi -mattr=+fullfp16,+thumb-mode | FileCheck %s
3
4; Check that frame lowering for the fp16 instructions works correctly with
5; negative offsets (which happens when using the frame pointer).
6
7define void @foo(i32 %count) {
8entry:
9  %half_alloca = alloca half, align 2
10; CHECK: vstr.16 {{s[0-9]+}}, [{{r[0-9]+}}, #-10]
11  store half 0.0, ptr %half_alloca
12  call void @bar(ptr %half_alloca)
13
14  ; A variable-sized alloca to force the above store to use the frame pointer
15  ; instead of the stack pointer, and so need a negative offset.
16  %var_alloca = alloca i32, i32 %count
17  call void @baz(ptr %var_alloca)
18  ret void
19}
20
21declare void @bar(ptr)
22declare void @baz(ptr)
23