xref: /llvm-project/llvm/test/CodeGen/BPF/objdump_fi_ri.ll (revision 806761a7629df268c8aed49657aeccffa6bca449)
1; RUN: llc -mtriple=bpfel -filetype=obj -o - %s \
2; RUN:     | llvm-objdump --no-print-imm-hex --arch=bpfel --section=foo -d - \
3; RUN:     | FileCheck %s
4
5; This test was added because "isPseudo" flag was missing in FI_ri
6; instruction definition and certain byte sequence caused an assertion
7; in llvm-objdump tool.
8
9; The value "G" is byte by byte little endian representation of the FI_ri instruction,
10; as declared in the BPFInstrInfo.td.
11; The first byte encodes an opcode: BPF_IMM(0x00) | BPF_DW(0x18) | BPF_LD(0x00)
12; The second byte encodes source and destination registers: 2 and 0 respectively.
13; The rest of the bytes are zeroes to comply with the specification.
14; An additional 8 bytes follow the instruction as an immediate 64 bit argument,
15; (because of the BPF_IMM flag).
16
17; This is a pseudo instruction, meaning that it's not possible to
18; write it in assembly directly. Thus it is coded as a byte array.
19
20; Note the "bpfel" flags in the RUN command.
21
22@G = constant [16 x i8]
23              [i8 u0x18, i8 u0x20, i8 u0x00, i8 u0x00, i8 u0x00, i8 u0x00, i8 u0x00, i8 u0x00,
24               i8 u0x00, i8 u0x00, i8 u0x00, i8 u0x00, i8 u0x00, i8 u0x00, i8 u0x00, i8 u0x00],
25              section "foo", align 8
26
27; CHECK-LABEL: G
28; CHECK:       0: 18 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ld_pseudo r0, 2, 0
29