55 lines · plain
1# Checking that we generate an OpNegateRAState CFI after the split point,2# when splitting a region with signed RA state.3# We split at the fallthrough label.4 5# REQUIRES: system-linux6 7# RUN: %clang %s %cflags -march=armv8.3-a -Wl,-q -o %t8# RUN: link_fdata --no-lbr %s %t %t.fdata9# RUN: llvm-bolt %t -o %t.bolt --data %t.fdata -split-functions \10# RUN: --print-only foo --print-split --print-all 2>&1 | FileCheck %s11 12# Checking that we don't see any OpNegateRAState CFIs before the insertion pass.13# CHECK-NOT: OpNegateRAState14# CHECK: Binary Function "foo" after insert-negate-ra-state-pass15 16# CHECK: paciasp17# CHECK-NEXT: OpNegateRAState18 19# CHECK: ------- HOT-COLD SPLIT POINT -------20 21# CHECK: OpNegateRAState22# CHECK-NEXT: mov x0, #0x123# CHECK-NEXT: autiasp24# CHECK-NEXT: OpNegateRAState25# CHECK-NEXT: ret26 27# End of the insert-negate-ra-state-pass logs28# CHECK: Binary Function "foo" after finalize-functions29 30 .text31 .globl foo32 .type foo, %function33foo:34.cfi_startproc35.entry_bb:36# FDATA: 1 foo #.entry_bb# 1037 paciasp38 .cfi_negate_ra_state // indicating that paciasp changed the RA state to signed39 cmp x0, #040 b.eq .Lcold_bb141.Lfallthrough: // split point42 mov x0, #143 autiasp44 .cfi_negate_ra_state // indicating that autiasp changed the RA state to unsigned45 ret46.Lcold_bb1: // Instructions below are not important, they are just here so the cold block is not empty.47 .cfi_negate_ra_state // ret has unsigned RA state, but the next inst (autiasp) has signed RA state48 mov x0, #249 retaa50.cfi_endproc51 .size foo, .-foo52 53## Force relocation mode.54.reloc 0, R_AARCH64_NONE55