brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.4 KiB · 704c9d4 Raw
39 lines · plain
1## Handle unrecognized arch attributes.2## Encode an unrecognized arch feature into an object file and try to decode it.3## The expected behavior is to ignore the unrecognized arch feature and4## continue to process the following arch features.5##6## The object file has the "rv32i2p0_m2p0_y1p0" arch feature. "y1p0" is an7## unrecognized architecture extension. llvm-objdump will ignore it and decode8## "mul" instruction correctly according to "m2p0" in the arch feature.9##10## This test cannot be assembly because the test needs an unrecognized arch11## feature and `llvm-mc` will filter out the unrecognized arch feature.12 13# RUN: yaml2obj %s -D BITS=32 -o %t.32.o14# RUN: llvm-objdump -d %t.32.o \15# RUN:   | FileCheck %s --check-prefixes=DISASM16# RUN: yaml2obj %s -D BITS=64 -o %t.64.o17# RUN: llvm-objdump -d %t.64.o \18# RUN:   | FileCheck %s --check-prefixes=DISASM19 20# DISASM: mul a0, a1, a221 22--- !ELF23FileHeader:24  Class:   ELFCLASS[[BITS]]25  Data:    ELFDATA2LSB26  Type:    ET_REL27  Machine: EM_RISCV28Sections:29  - Name:    .text30    Type:    SHT_PROGBITS31    Flags:   [ SHF_ALLOC, SHF_EXECINSTR ]32## The content is the encoding of "mul a0, a1, a2".33## The encoding could be decoded only when the "m" extension is enabled.34    Content: 3385C50235  - Name:    .riscv.attributes36    Type:    SHT_RISCV_ATTRIBUTES37## The content is the encoding of the arch feature "rv32i2p0_m2p0_y1p0"38    Content: 412300000072697363760001190000000572763332693270305F6D3270305F793170300039