brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.3 KiB · 942f128 Raw
29 lines · plain
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 %s4 5; This test was added because "isPseudo" flag was missing in FI_ri6; instruction definition and certain byte sequence caused an assertion7; 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 to18; 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 826 27; CHECK-LABEL: G28; CHECK:       0: 18 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ld_pseudo r0, 2, 029