[ARM] Add Tag_CPU_arch missing value descriptions in attribute parser
authorVictor Campos <victor.campos@arm.com>
Tue, 12 Jul 2022 15:13:12 +0000 (16:13 +0100)
committerVictor Campos <victor.campos@arm.com>
Tue, 26 Jul 2022 07:32:40 +0000 (08:32 +0100)
The ARM attribute parser for Tag_CPU_arch is missing value descriptions
for Armv8-A and Armv8-R.

This patch adds these descriptions.

Reviewed By: pratlucas

Differential Revision: https://reviews.llvm.org/D129631

llvm/lib/Support/ARMAttributeParser.cpp
llvm/test/MC/ARM/directive-eabi_attribute-cpu_arch-armv8a.s [new file with mode: 0644]
llvm/test/MC/ARM/directive-eabi_attribute-cpu_arch-armv8r.s [new file with mode: 0644]

index adb5d3f..03c0c7a 100644 (file)
@@ -85,7 +85,7 @@ Error ARMAttributeParser::CPU_arch(AttrType tag) {
   static const char *strings[] = {
     "Pre-v4", "ARM v4", "ARM v4T", "ARM v5T", "ARM v5TE", "ARM v5TEJ", "ARM v6",
     "ARM v6KZ", "ARM v6T2", "ARM v6K", "ARM v7", "ARM v6-M", "ARM v6S-M",
-    "ARM v7E-M", "ARM v8", nullptr,
+    "ARM v7E-M", "ARM v8-A", "ARM v8-R",
     "ARM v8-M Baseline", "ARM v8-M Mainline", nullptr, nullptr, nullptr,
     "ARM v8.1-M Mainline", "ARM v9-A"
   };
diff --git a/llvm/test/MC/ARM/directive-eabi_attribute-cpu_arch-armv8a.s b/llvm/test/MC/ARM/directive-eabi_attribute-cpu_arch-armv8a.s
new file mode 100644 (file)
index 0000000..d8849aa
--- /dev/null
@@ -0,0 +1,11 @@
+@ RUN: llvm-mc -triple arm -filetype asm -o - %s | FileCheck %s
+@ RUN: llvm-mc -triple arm -filetype obj -o - %s | llvm-readobj -A - | \
+@ RUN: FileCheck %s --check-prefix=CHECK-OBJ
+
+.eabi_attribute Tag_CPU_arch, 14
+@ CHECK:          .eabi_attribute 6, 14 @ Tag_CPU_arch
+@ CHECK-OBJ:      Attribute
+@ CHECK-OBJ: Tag: 6
+@ CHECK-OBJ-NEXT: Value: 14
+@ CHECK-OBJ-NEXT: TagName: CPU_arch
+@ CHECK-OBJ-NEXT: Description: ARM v8-A
diff --git a/llvm/test/MC/ARM/directive-eabi_attribute-cpu_arch-armv8r.s b/llvm/test/MC/ARM/directive-eabi_attribute-cpu_arch-armv8r.s
new file mode 100644 (file)
index 0000000..7a6c666
--- /dev/null
@@ -0,0 +1,11 @@
+@ RUN: llvm-mc -triple arm -filetype asm -o - %s | FileCheck %s
+@ RUN: llvm-mc -triple arm -filetype obj -o - %s | llvm-readobj -A - | \
+@ RUN: FileCheck %s --check-prefix=CHECK-OBJ
+
+.eabi_attribute Tag_CPU_arch, 15
+@ CHECK:          .eabi_attribute 6, 15 @ Tag_CPU_arch
+@ CHECK-OBJ:      Attribute
+@ CHECK-OBJ: Tag: 6
+@ CHECK-OBJ-NEXT: Value: 15
+@ CHECK-OBJ-NEXT: TagName: CPU_arch
+@ CHECK-OBJ-NEXT: Description: ARM v8-R