[llvm] [Hexagon] Fix arch attribute mapping in ELFObjectFile (PR #201531)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 5 04:13:56 PDT 2026
================
@@ -0,0 +1,27 @@
+// Regression test for hexagonAttrToFeatureString in
+/// llvm/lib/Object/ELFObjectFile.cpp.
+///
+
+r0 = add(r1,r2)
+
+// RUN: llvm-mc -triple=hexagon --mcpu=hexagonv68 %s \
+// RUN: -filetype=obj --hexagon-add-build-attributes -o %t.v68.o
+// RUN: llvm-readelf -A %t.v68.o | FileCheck %s --check-prefix=V68
+// RUN: llvm-objdump -d %t.v68.o | FileCheck %s --check-prefix=DIS
+
+// RUN: llvm-mc -triple=hexagon --mcpu=hexagonv75 %s \
+// RUN: -filetype=obj --hexagon-add-build-attributes -o %t.v75.o
+// RUN: llvm-readelf -A %t.v75.o | FileCheck %s --check-prefix=V75
+// RUN: llvm-objdump -d %t.v75.o | FileCheck %s --check-prefix=DIS
+
+/// Each readelf invocation should record the matching arch tag value.
+// V68: TagName: arch
+// V68-NEXT: Value: 68
+// V75: TagName: arch
+// V75-NEXT: Value: 75
+
+/// llvm-objdump should disassemble the instruction correctly for every
+/// arch version, with no <unknown> fallback.
+// DIS: <.text>:
+// DIS-NEXT: r0 = add(r1,r2)
+// DIS-NOT: <unknown>
----------------
Ris-Bali wrote:
Done
https://github.com/llvm/llvm-project/pull/201531
More information about the llvm-commits
mailing list