Re-land [openmp] Fix warnings when building on Windows with latest MSVC or Clang...
[llvm-project.git] / llvm / test / CodeGen / AArch64 / sme-support-routines-calling-convention.ll
blobd88deec40ce72f71e0168d97cff3e5899154d764
1 ; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sme -verify-machineinstrs < %s | FileCheck %s
2 ; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sme -verify-machineinstrs -stop-after=finalize-isel < %s | FileCheck %s --check-prefix=CHECK-CSRMASK
4 ; Test that the PCS attribute is accepted and uses the correct register mask.
7 define void @test_sme_calling_convention_x0() nounwind {
8 ; CHECK-LABEL: test_sme_calling_convention_x0:
9 ; CHECK:       // %bb.0:
10 ; CHECK-NEXT:    str x30, [sp, #-16]! // 8-byte Folded Spill
11 ; CHECK-NEXT:    bl __arm_tpidr2_save
12 ; CHECK-NEXT:    ldr x30, [sp], #16 // 8-byte Folded Reload
13 ; CHECK-NEXT:    ret
15 ; CHECK-CSRMASK-LABEL: name: test_sme_calling_convention_x0
16 ; CHECK-CSRMASK: BL @__arm_tpidr2_save, csr_aarch64_sme_abi_support_routines_preservemost_from_x0
17   call aarch64_sme_preservemost_from_x0 void @__arm_tpidr2_save()
18   ret void
21 define i64 @test_sme_calling_convention_x2() nounwind {
22 ; CHECK-LABEL: test_sme_calling_convention_x2:
23 ; CHECK:       // %bb.0:
24 ; CHECK-NEXT:    str x30, [sp, #-16]! // 8-byte Folded Spill
25 ; CHECK-NEXT:    bl __arm_sme_state
26 ; CHECK-NEXT:    ldr x30, [sp], #16 // 8-byte Folded Reload
27 ; CHECK-NEXT:    ret
29 ; CHECK-CSRMASK-LABEL: name: test_sme_calling_convention_x2
30 ; CHECK-CSRMASK: BL @__arm_sme_state, csr_aarch64_sme_abi_support_routines_preservemost_from_x2
31   %pstate = call aarch64_sme_preservemost_from_x2 {i64, i64} @__arm_sme_state()
32   %pstate.sm = extractvalue {i64, i64} %pstate, 0
33   ret i64 %pstate.sm
36 declare void @__arm_tpidr2_save()
37 declare {i64, i64} @__arm_sme_state()