xref: /llvm-project/bolt/test/RISCV/cie-gnu.test (revision 6795bfce4ded6abf2403db62a5fec89a8bcb256a)
1# Test that BOLT can handle CIE's produced by GNU as. On RISC-V, GNU as produces
2# the following initial instruction:
3# DW_CFA_def_cfa_register: r2
4# While I believe it is technically incorrect to use this instruction without
5# first using a DW_CFA_def_cfa (since the offset is unspecified), both readelf
6# and llvm-dwarfdump accept this and implicitly set the offset to 0.
7# In BOLT, this used to trigger an assert, however, since it (correctly)
8# believed the offset was not set. This test checks we can handle this
9# situation.
10
11RUN: yaml2obj -o %t %p/Inputs/cie-gnu.yaml
12RUN: llvm-bolt -o %t.bolt %t --reorder-blocks=reverse
13RUN: llvm-dwarfdump --debug-frame %t.bolt | FileCheck %s
14
15CHECK: 0x400000: CFA=X2
16CHECK: 0x400004: CFA=X2: X5=undefined
17CHECK: 0x400006: CFA=X2
18