[llvm] [ARM] Fix missing ELF FPU attributes for fp-armv8-fullfp16-d16 (PR #105677)

Rodolfo Wottrich via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 22 08:12:44 PDT 2024


https://github.com/rgwott created https://github.com/llvm/llvm-project/pull/105677

An assembly input with
  .fpu fp-armv8-fullfp16-d16
crashes the compiler because the ELF FPU attribute emitter misses the
respective entry. This patch fixes this.

Interestingly, compiling with -mfpu=fp-armv8-fullfp16-d16 does not cause
the crash because FPv5_D16 is an alias in the compiler and
  .fpu fpv5-d16
is emitted instead, which does not crash.

The existing .fpu directive test with multiple FPUs serves the purpose
of verifying that each possible FPU option is defined, but does not
trigger the crash because only the last .fpu directive goes effectively
down the code path. Therefore one test for each FPU is required.

>From 620f1dd9cc68f8ddf819098a6b124702b325f469 Mon Sep 17 00:00:00 2001
From: Rodolfo Wottrich <rodolfo.wottrich at arm.com>
Date: Thu, 22 Aug 2024 16:04:49 +0100
Subject: [PATCH 1/2] [ARM] Fix missing ELF FPU attributes for
 fp-armv8-fullfp16-d16

An assembly input with
  .fpu fp-armv8-fullfp16-d16
crashes the compiler because the ELF FPU attribute emitter misses the
respective entry. This patch fixes this.

Interestingly, compiling with -mfpu=fp-armv8-fullfp16-d16 does not cause
the crash because FPv5_D16 is an alias in the compiler and
  .fpu fpv5-d16
is emitted instead, which does not crash.

The existing .fpu directive test with multiple FPUs serves the purpose
of verifying that each possible FPU option is defined, but does not
trigger the crash because only the last .fpu directive goes effectively
down the code path. Therefore one test for each FPU is required.
---
 .../lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp |  4 ++++
 llvm/test/MC/ARM/directive-fpu-multiple.s          |  2 ++
 .../directive-fpu-single-crypto-neon-fp-armv8.s    | 14 ++++++++++++++
 .../directive-fpu-single-fp-armv8-fullfp16-d16.s   | 14 ++++++++++++++
 ...directive-fpu-single-fp-armv8-fullfp16-sp-d16.s | 14 ++++++++++++++
 llvm/test/MC/ARM/directive-fpu-single-fp-armv8.s   | 14 ++++++++++++++
 .../test/MC/ARM/directive-fpu-single-fpv4-sp-d16.s | 14 ++++++++++++++
 llvm/test/MC/ARM/directive-fpu-single-fpv5-d16.s   | 14 ++++++++++++++
 .../test/MC/ARM/directive-fpu-single-fpv5-sp-d16.s | 14 ++++++++++++++
 .../MC/ARM/directive-fpu-single-neon-fp-armv8.s    | 14 ++++++++++++++
 llvm/test/MC/ARM/directive-fpu-single-neon-fp16.s  | 14 ++++++++++++++
 llvm/test/MC/ARM/directive-fpu-single-neon-vfpv4.s | 14 ++++++++++++++
 llvm/test/MC/ARM/directive-fpu-single-neon.s       | 14 ++++++++++++++
 llvm/test/MC/ARM/directive-fpu-single-none.s       |  9 +++++++++
 llvm/test/MC/ARM/directive-fpu-single-vfp.s        | 14 ++++++++++++++
 llvm/test/MC/ARM/directive-fpu-single-vfpv2.s      | 14 ++++++++++++++
 .../MC/ARM/directive-fpu-single-vfpv3-d16-fp16.s   | 14 ++++++++++++++
 llvm/test/MC/ARM/directive-fpu-single-vfpv3-d16.s  | 14 ++++++++++++++
 llvm/test/MC/ARM/directive-fpu-single-vfpv3-fp16.s | 14 ++++++++++++++
 llvm/test/MC/ARM/directive-fpu-single-vfpv3.s      | 14 ++++++++++++++
 .../MC/ARM/directive-fpu-single-vfpv3xd-fp16.s     | 14 ++++++++++++++
 llvm/test/MC/ARM/directive-fpu-single-vfpv3xd.s    | 14 ++++++++++++++
 llvm/test/MC/ARM/directive-fpu-single-vfpv4-d16.s  | 14 ++++++++++++++
 llvm/test/MC/ARM/directive-fpu-single-vfpv4.s      | 14 ++++++++++++++
 24 files changed, 309 insertions(+)
 create mode 100644 llvm/test/MC/ARM/directive-fpu-single-crypto-neon-fp-armv8.s
 create mode 100644 llvm/test/MC/ARM/directive-fpu-single-fp-armv8-fullfp16-d16.s
 create mode 100644 llvm/test/MC/ARM/directive-fpu-single-fp-armv8-fullfp16-sp-d16.s
 create mode 100644 llvm/test/MC/ARM/directive-fpu-single-fp-armv8.s
 create mode 100644 llvm/test/MC/ARM/directive-fpu-single-fpv4-sp-d16.s
 create mode 100644 llvm/test/MC/ARM/directive-fpu-single-fpv5-d16.s
 create mode 100644 llvm/test/MC/ARM/directive-fpu-single-fpv5-sp-d16.s
 create mode 100644 llvm/test/MC/ARM/directive-fpu-single-neon-fp-armv8.s
 create mode 100644 llvm/test/MC/ARM/directive-fpu-single-neon-fp16.s
 create mode 100644 llvm/test/MC/ARM/directive-fpu-single-neon-vfpv4.s
 create mode 100644 llvm/test/MC/ARM/directive-fpu-single-neon.s
 create mode 100644 llvm/test/MC/ARM/directive-fpu-single-none.s
 create mode 100644 llvm/test/MC/ARM/directive-fpu-single-vfp.s
 create mode 100644 llvm/test/MC/ARM/directive-fpu-single-vfpv2.s
 create mode 100644 llvm/test/MC/ARM/directive-fpu-single-vfpv3-d16-fp16.s
 create mode 100644 llvm/test/MC/ARM/directive-fpu-single-vfpv3-d16.s
 create mode 100644 llvm/test/MC/ARM/directive-fpu-single-vfpv3-fp16.s
 create mode 100644 llvm/test/MC/ARM/directive-fpu-single-vfpv3.s
 create mode 100644 llvm/test/MC/ARM/directive-fpu-single-vfpv3xd-fp16.s
 create mode 100644 llvm/test/MC/ARM/directive-fpu-single-vfpv3xd.s
 create mode 100644 llvm/test/MC/ARM/directive-fpu-single-vfpv4-d16.s
 create mode 100644 llvm/test/MC/ARM/directive-fpu-single-vfpv4.s

diff --git a/llvm/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp b/llvm/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp
index 59f29660a77770..c9631bd7c7aac5 100644
--- a/llvm/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp
+++ b/llvm/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp
@@ -992,6 +992,10 @@ void ARMTargetELFStreamer::emitFPUDefaultAttributes() {
   // uses the FP_ARMV8_D16 build attribute.
   case ARM::FK_FPV5_SP_D16:
   case ARM::FK_FPV5_D16:
+  // FPv5 and FP-ARMv8 have the same instructions, so are modeled as one
+  // FPU, but there are two different names for it depending on the CPU.
+  case ARM::FK_FP_ARMV8_FULLFP16_SP_D16:
+  case ARM::FK_FP_ARMV8_FULLFP16_D16:
     S.setAttributeItem(ARMBuildAttrs::FP_arch, ARMBuildAttrs::AllowFPARMv8B,
                        /* OverwriteExisting= */ false);
     break;
diff --git a/llvm/test/MC/ARM/directive-fpu-multiple.s b/llvm/test/MC/ARM/directive-fpu-multiple.s
index ba407654854cd7..b129cbdf1db230 100644
--- a/llvm/test/MC/ARM/directive-fpu-multiple.s
+++ b/llvm/test/MC/ARM/directive-fpu-multiple.s
@@ -22,6 +22,8 @@
 	.fpu fpv5-d16
 	.fpu fpv5-sp-d16
 	.fpu fp-armv8
+	.fpu fp-armv8-fullfp16-d16
+	.fpu fp-armv8-fullfp16-sp-d16
 	.fpu neon
 	.fpu neon-fp16
 	.fpu neon-vfpv4
diff --git a/llvm/test/MC/ARM/directive-fpu-single-crypto-neon-fp-armv8.s b/llvm/test/MC/ARM/directive-fpu-single-crypto-neon-fp-armv8.s
new file mode 100644
index 00000000000000..ea423f01c37fbc
--- /dev/null
+++ b/llvm/test/MC/ARM/directive-fpu-single-crypto-neon-fp-armv8.s
@@ -0,0 +1,14 @@
+@ Check a single .fpu directive.
+
+@ RUN: llvm-mc -triple arm-eabi -filetype obj %s \
+@ RUN:   | llvm-readobj --arch-specific - \
+@ RUN:   | FileCheck %s -check-prefix CHECK-ATTR
+
+  .fpu crypto-neon-fp-armv8
+
+@ CHECK-ATTR: FileAttributes {
+@ CHECK-ATTR:   Attribute {
+@ CHECK-ATTR:     TagName: FP_arch
+@ CHECK-ATTR:     Description: ARMv8-a FP
+@ CHECK-ATTR:   }
+@ CHECK-ATTR: }
\ No newline at end of file
diff --git a/llvm/test/MC/ARM/directive-fpu-single-fp-armv8-fullfp16-d16.s b/llvm/test/MC/ARM/directive-fpu-single-fp-armv8-fullfp16-d16.s
new file mode 100644
index 00000000000000..652c5ce3aea76b
--- /dev/null
+++ b/llvm/test/MC/ARM/directive-fpu-single-fp-armv8-fullfp16-d16.s
@@ -0,0 +1,14 @@
+@ Check a single .fpu directive.
+
+@ RUN: llvm-mc -triple arm-eabi -filetype obj %s \
+@ RUN:   | llvm-readobj --arch-specific - \
+@ RUN:   | FileCheck %s -check-prefix CHECK-ATTR
+
+  .fpu fp-armv8-fullfp16-d16
+
+@ CHECK-ATTR: FileAttributes {
+@ CHECK-ATTR:   Attribute {
+@ CHECK-ATTR:     TagName: FP_arch
+@ CHECK-ATTR:     Description: ARMv8-a FP-D16
+@ CHECK-ATTR:   }
+@ CHECK-ATTR: }
\ No newline at end of file
diff --git a/llvm/test/MC/ARM/directive-fpu-single-fp-armv8-fullfp16-sp-d16.s b/llvm/test/MC/ARM/directive-fpu-single-fp-armv8-fullfp16-sp-d16.s
new file mode 100644
index 00000000000000..c88c8e0d2e2697
--- /dev/null
+++ b/llvm/test/MC/ARM/directive-fpu-single-fp-armv8-fullfp16-sp-d16.s
@@ -0,0 +1,14 @@
+@ Check a single .fpu directive.
+
+@ RUN: llvm-mc -triple arm-eabi -filetype obj %s \
+@ RUN:   | llvm-readobj --arch-specific - \
+@ RUN:   | FileCheck %s -check-prefix CHECK-ATTR
+
+  .fpu fp-armv8-fullfp16-sp-d16
+
+@ CHECK-ATTR: FileAttributes {
+@ CHECK-ATTR:   Attribute {
+@ CHECK-ATTR:     TagName: FP_arch
+@ CHECK-ATTR:     Description: ARMv8-a FP-D16
+@ CHECK-ATTR:   }
+@ CHECK-ATTR: }
\ No newline at end of file
diff --git a/llvm/test/MC/ARM/directive-fpu-single-fp-armv8.s b/llvm/test/MC/ARM/directive-fpu-single-fp-armv8.s
new file mode 100644
index 00000000000000..dcacb22c934b60
--- /dev/null
+++ b/llvm/test/MC/ARM/directive-fpu-single-fp-armv8.s
@@ -0,0 +1,14 @@
+@ Check a single .fpu directive.
+
+@ RUN: llvm-mc -triple arm-eabi -filetype obj %s \
+@ RUN:   | llvm-readobj --arch-specific - \
+@ RUN:   | FileCheck %s -check-prefix CHECK-ATTR
+
+  .fpu fp-armv8
+
+@ CHECK-ATTR: FileAttributes {
+@ CHECK-ATTR:   Attribute {
+@ CHECK-ATTR:     TagName: FP_arch
+@ CHECK-ATTR:     Description: ARMv8-a FP
+@ CHECK-ATTR:   }
+@ CHECK-ATTR: }
\ No newline at end of file
diff --git a/llvm/test/MC/ARM/directive-fpu-single-fpv4-sp-d16.s b/llvm/test/MC/ARM/directive-fpu-single-fpv4-sp-d16.s
new file mode 100644
index 00000000000000..97a12d68c1fa1e
--- /dev/null
+++ b/llvm/test/MC/ARM/directive-fpu-single-fpv4-sp-d16.s
@@ -0,0 +1,14 @@
+@ Check a single .fpu directive.
+
+@ RUN: llvm-mc -triple arm-eabi -filetype obj %s \
+@ RUN:   | llvm-readobj --arch-specific - \
+@ RUN:   | FileCheck %s -check-prefix CHECK-ATTR
+
+  .fpu fpv4-sp-d16
+
+@ CHECK-ATTR: FileAttributes {
+@ CHECK-ATTR:   Attribute {
+@ CHECK-ATTR:     TagName: FP_arch
+@ CHECK-ATTR:     Description: VFPv4-D16
+@ CHECK-ATTR:   }
+@ CHECK-ATTR: }
\ No newline at end of file
diff --git a/llvm/test/MC/ARM/directive-fpu-single-fpv5-d16.s b/llvm/test/MC/ARM/directive-fpu-single-fpv5-d16.s
new file mode 100644
index 00000000000000..1965107d3e78cc
--- /dev/null
+++ b/llvm/test/MC/ARM/directive-fpu-single-fpv5-d16.s
@@ -0,0 +1,14 @@
+@ Check a single .fpu directive.
+
+@ RUN: llvm-mc -triple arm-eabi -filetype obj %s \
+@ RUN:   | llvm-readobj --arch-specific - \
+@ RUN:   | FileCheck %s -check-prefix CHECK-ATTR
+
+  .fpu fpv5-d16
+
+@ CHECK-ATTR: FileAttributes {
+@ CHECK-ATTR:   Attribute {
+@ CHECK-ATTR:     TagName: FP_arch
+@ CHECK-ATTR:     Description: ARMv8-a FP-D16
+@ CHECK-ATTR:   }
+@ CHECK-ATTR: }
\ No newline at end of file
diff --git a/llvm/test/MC/ARM/directive-fpu-single-fpv5-sp-d16.s b/llvm/test/MC/ARM/directive-fpu-single-fpv5-sp-d16.s
new file mode 100644
index 00000000000000..e362c1af18f5a1
--- /dev/null
+++ b/llvm/test/MC/ARM/directive-fpu-single-fpv5-sp-d16.s
@@ -0,0 +1,14 @@
+@ Check a single .fpu directive.
+
+@ RUN: llvm-mc -triple arm-eabi -filetype obj %s \
+@ RUN:   | llvm-readobj --arch-specific - \
+@ RUN:   | FileCheck %s -check-prefix CHECK-ATTR
+
+  .fpu fpv5-sp-d16
+
+@ CHECK-ATTR: FileAttributes {
+@ CHECK-ATTR:   Attribute {
+@ CHECK-ATTR:     TagName: FP_arch
+@ CHECK-ATTR:     Description: ARMv8-a FP-D16
+@ CHECK-ATTR:   }
+@ CHECK-ATTR: }
\ No newline at end of file
diff --git a/llvm/test/MC/ARM/directive-fpu-single-neon-fp-armv8.s b/llvm/test/MC/ARM/directive-fpu-single-neon-fp-armv8.s
new file mode 100644
index 00000000000000..6991738c09fb94
--- /dev/null
+++ b/llvm/test/MC/ARM/directive-fpu-single-neon-fp-armv8.s
@@ -0,0 +1,14 @@
+@ Check a single .fpu directive.
+
+@ RUN: llvm-mc -triple arm-eabi -filetype obj %s \
+@ RUN:   | llvm-readobj --arch-specific - \
+@ RUN:   | FileCheck %s -check-prefix CHECK-ATTR
+
+  .fpu neon-fp-armv8
+
+@ CHECK-ATTR: FileAttributes {
+@ CHECK-ATTR:   Attribute {
+@ CHECK-ATTR:     TagName: FP_arch
+@ CHECK-ATTR:     Description: ARMv8-a FP
+@ CHECK-ATTR:   }
+@ CHECK-ATTR: }
\ No newline at end of file
diff --git a/llvm/test/MC/ARM/directive-fpu-single-neon-fp16.s b/llvm/test/MC/ARM/directive-fpu-single-neon-fp16.s
new file mode 100644
index 00000000000000..8bf0750fa84234
--- /dev/null
+++ b/llvm/test/MC/ARM/directive-fpu-single-neon-fp16.s
@@ -0,0 +1,14 @@
+@ Check a single .fpu directive.
+
+@ RUN: llvm-mc -triple arm-eabi -filetype obj %s \
+@ RUN:   | llvm-readobj --arch-specific - \
+@ RUN:   | FileCheck %s -check-prefix CHECK-ATTR
+
+  .fpu neon-fp16
+
+@ CHECK-ATTR: FileAttributes {
+@ CHECK-ATTR:   Attribute {
+@ CHECK-ATTR:     TagName: FP_arch
+@ CHECK-ATTR:     Description: VFPv3
+@ CHECK-ATTR:   }
+@ CHECK-ATTR: }
\ No newline at end of file
diff --git a/llvm/test/MC/ARM/directive-fpu-single-neon-vfpv4.s b/llvm/test/MC/ARM/directive-fpu-single-neon-vfpv4.s
new file mode 100644
index 00000000000000..02d77a8814a24d
--- /dev/null
+++ b/llvm/test/MC/ARM/directive-fpu-single-neon-vfpv4.s
@@ -0,0 +1,14 @@
+@ Check a single .fpu directive.
+
+@ RUN: llvm-mc -triple arm-eabi -filetype obj %s \
+@ RUN:   | llvm-readobj --arch-specific - \
+@ RUN:   | FileCheck %s -check-prefix CHECK-ATTR
+
+  .fpu neon-vfpv4
+
+@ CHECK-ATTR: FileAttributes {
+@ CHECK-ATTR:   Attribute {
+@ CHECK-ATTR:     TagName: FP_arch
+@ CHECK-ATTR:     Description: VFPv4
+@ CHECK-ATTR:   }
+@ CHECK-ATTR: }
\ No newline at end of file
diff --git a/llvm/test/MC/ARM/directive-fpu-single-neon.s b/llvm/test/MC/ARM/directive-fpu-single-neon.s
new file mode 100644
index 00000000000000..17c2b17572998a
--- /dev/null
+++ b/llvm/test/MC/ARM/directive-fpu-single-neon.s
@@ -0,0 +1,14 @@
+@ Check a single .fpu directive.
+
+@ RUN: llvm-mc -triple arm-eabi -filetype obj %s \
+@ RUN:   | llvm-readobj --arch-specific - \
+@ RUN:   | FileCheck %s -check-prefix CHECK-ATTR
+
+  .fpu neon
+
+@ CHECK-ATTR: FileAttributes {
+@ CHECK-ATTR:   Attribute {
+@ CHECK-ATTR:     TagName: FP_arch
+@ CHECK-ATTR:     Description: VFPv3
+@ CHECK-ATTR:   }
+@ CHECK-ATTR: }
\ No newline at end of file
diff --git a/llvm/test/MC/ARM/directive-fpu-single-none.s b/llvm/test/MC/ARM/directive-fpu-single-none.s
new file mode 100644
index 00000000000000..c33d0b642e1f41
--- /dev/null
+++ b/llvm/test/MC/ARM/directive-fpu-single-none.s
@@ -0,0 +1,9 @@
+@ Check a single .fpu directive.
+
+@ RUN: llvm-mc -triple arm-eabi -filetype obj %s \
+@ RUN:   | llvm-readobj --arch-specific - \
+@ RUN:   | FileCheck %s -check-prefix CHECK-ATTR
+
+  .fpu none
+
+@ CHECK-ATTR-NOT:     TagName: FP_arch
\ No newline at end of file
diff --git a/llvm/test/MC/ARM/directive-fpu-single-vfp.s b/llvm/test/MC/ARM/directive-fpu-single-vfp.s
new file mode 100644
index 00000000000000..e3b2ea50cfa107
--- /dev/null
+++ b/llvm/test/MC/ARM/directive-fpu-single-vfp.s
@@ -0,0 +1,14 @@
+@ Check a single .fpu directive.
+
+@ RUN: llvm-mc -triple arm-eabi -filetype obj %s \
+@ RUN:   | llvm-readobj --arch-specific - \
+@ RUN:   | FileCheck %s -check-prefix CHECK-ATTR
+
+  .fpu vfp
+
+@ CHECK-ATTR: FileAttributes {
+@ CHECK-ATTR:   Attribute {
+@ CHECK-ATTR:     TagName: FP_arch
+@ CHECK-ATTR:     Description: VFPv2
+@ CHECK-ATTR:   }
+@ CHECK-ATTR: }
\ No newline at end of file
diff --git a/llvm/test/MC/ARM/directive-fpu-single-vfpv2.s b/llvm/test/MC/ARM/directive-fpu-single-vfpv2.s
new file mode 100644
index 00000000000000..ebbe521abe58d8
--- /dev/null
+++ b/llvm/test/MC/ARM/directive-fpu-single-vfpv2.s
@@ -0,0 +1,14 @@
+@ Check a single .fpu directive.
+
+@ RUN: llvm-mc -triple arm-eabi -filetype obj %s \
+@ RUN:   | llvm-readobj --arch-specific - \
+@ RUN:   | FileCheck %s -check-prefix CHECK-ATTR
+
+  .fpu vfp2
+
+@ CHECK-ATTR: FileAttributes {
+@ CHECK-ATTR:   Attribute {
+@ CHECK-ATTR:     TagName: FP_arch
+@ CHECK-ATTR:     Description: VFPv2
+@ CHECK-ATTR:   }
+@ CHECK-ATTR: }
\ No newline at end of file
diff --git a/llvm/test/MC/ARM/directive-fpu-single-vfpv3-d16-fp16.s b/llvm/test/MC/ARM/directive-fpu-single-vfpv3-d16-fp16.s
new file mode 100644
index 00000000000000..83b11db50d22ed
--- /dev/null
+++ b/llvm/test/MC/ARM/directive-fpu-single-vfpv3-d16-fp16.s
@@ -0,0 +1,14 @@
+@ Check a single .fpu directive.
+
+@ RUN: llvm-mc -triple arm-eabi -filetype obj %s \
+@ RUN:   | llvm-readobj --arch-specific - \
+@ RUN:   | FileCheck %s -check-prefix CHECK-ATTR
+
+  .fpu vfpv3-d16-fp16
+
+@ CHECK-ATTR: FileAttributes {
+@ CHECK-ATTR:   Attribute {
+@ CHECK-ATTR:     TagName: FP_arch
+@ CHECK-ATTR:     Description: VFPv3-D16
+@ CHECK-ATTR:   }
+@ CHECK-ATTR: }
\ No newline at end of file
diff --git a/llvm/test/MC/ARM/directive-fpu-single-vfpv3-d16.s b/llvm/test/MC/ARM/directive-fpu-single-vfpv3-d16.s
new file mode 100644
index 00000000000000..d6eb7b9eab0056
--- /dev/null
+++ b/llvm/test/MC/ARM/directive-fpu-single-vfpv3-d16.s
@@ -0,0 +1,14 @@
+@ Check a single .fpu directive.
+
+@ RUN: llvm-mc -triple arm-eabi -filetype obj %s \
+@ RUN:   | llvm-readobj --arch-specific - \
+@ RUN:   | FileCheck %s -check-prefix CHECK-ATTR
+
+  .fpu vfp3-d16
+
+@ CHECK-ATTR: FileAttributes {
+@ CHECK-ATTR:   Attribute {
+@ CHECK-ATTR:     TagName: FP_arch
+@ CHECK-ATTR:     Description: VFPv3-D16
+@ CHECK-ATTR:   }
+@ CHECK-ATTR: }
\ No newline at end of file
diff --git a/llvm/test/MC/ARM/directive-fpu-single-vfpv3-fp16.s b/llvm/test/MC/ARM/directive-fpu-single-vfpv3-fp16.s
new file mode 100644
index 00000000000000..fbf3a2c95ef33c
--- /dev/null
+++ b/llvm/test/MC/ARM/directive-fpu-single-vfpv3-fp16.s
@@ -0,0 +1,14 @@
+@ Check a single .fpu directive.
+
+@ RUN: llvm-mc -triple arm-eabi -filetype obj %s \
+@ RUN:   | llvm-readobj --arch-specific - \
+@ RUN:   | FileCheck %s -check-prefix CHECK-ATTR
+
+  .fpu vfpv3-fp16
+
+@ CHECK-ATTR: FileAttributes {
+@ CHECK-ATTR:   Attribute {
+@ CHECK-ATTR:     TagName: FP_arch
+@ CHECK-ATTR:     Description: VFPv3
+@ CHECK-ATTR:   }
+@ CHECK-ATTR: }
\ No newline at end of file
diff --git a/llvm/test/MC/ARM/directive-fpu-single-vfpv3.s b/llvm/test/MC/ARM/directive-fpu-single-vfpv3.s
new file mode 100644
index 00000000000000..a8b32d6b1e4ecc
--- /dev/null
+++ b/llvm/test/MC/ARM/directive-fpu-single-vfpv3.s
@@ -0,0 +1,14 @@
+@ Check a single .fpu directive.
+
+@ RUN: llvm-mc -triple arm-eabi -filetype obj %s \
+@ RUN:   | llvm-readobj --arch-specific - \
+@ RUN:   | FileCheck %s -check-prefix CHECK-ATTR
+
+  .fpu vfp3
+
+@ CHECK-ATTR: FileAttributes {
+@ CHECK-ATTR:   Attribute {
+@ CHECK-ATTR:     TagName: FP_arch
+@ CHECK-ATTR:     Description: VFPv3
+@ CHECK-ATTR:   }
+@ CHECK-ATTR: }
\ No newline at end of file
diff --git a/llvm/test/MC/ARM/directive-fpu-single-vfpv3xd-fp16.s b/llvm/test/MC/ARM/directive-fpu-single-vfpv3xd-fp16.s
new file mode 100644
index 00000000000000..4e6e909dbc644c
--- /dev/null
+++ b/llvm/test/MC/ARM/directive-fpu-single-vfpv3xd-fp16.s
@@ -0,0 +1,14 @@
+@ Check a single .fpu directive.
+
+@ RUN: llvm-mc -triple arm-eabi -filetype obj %s \
+@ RUN:   | llvm-readobj --arch-specific - \
+@ RUN:   | FileCheck %s -check-prefix CHECK-ATTR
+
+  .fpu vfpv3xd-fp16
+
+@ CHECK-ATTR: FileAttributes {
+@ CHECK-ATTR:   Attribute {
+@ CHECK-ATTR:     TagName: FP_arch
+@ CHECK-ATTR:     Description: VFPv3-D16
+@ CHECK-ATTR:   }
+@ CHECK-ATTR: }
\ No newline at end of file
diff --git a/llvm/test/MC/ARM/directive-fpu-single-vfpv3xd.s b/llvm/test/MC/ARM/directive-fpu-single-vfpv3xd.s
new file mode 100644
index 00000000000000..ae1d064df450e9
--- /dev/null
+++ b/llvm/test/MC/ARM/directive-fpu-single-vfpv3xd.s
@@ -0,0 +1,14 @@
+@ Check a single .fpu directive.
+
+@ RUN: llvm-mc -triple arm-eabi -filetype obj %s \
+@ RUN:   | llvm-readobj --arch-specific - \
+@ RUN:   | FileCheck %s -check-prefix CHECK-ATTR
+
+  .fpu vfpv3xd
+
+@ CHECK-ATTR: FileAttributes {
+@ CHECK-ATTR:   Attribute {
+@ CHECK-ATTR:     TagName: FP_arch
+@ CHECK-ATTR:     Description: VFPv3-D16
+@ CHECK-ATTR:   }
+@ CHECK-ATTR: }
\ No newline at end of file
diff --git a/llvm/test/MC/ARM/directive-fpu-single-vfpv4-d16.s b/llvm/test/MC/ARM/directive-fpu-single-vfpv4-d16.s
new file mode 100644
index 00000000000000..8626dbea7fee91
--- /dev/null
+++ b/llvm/test/MC/ARM/directive-fpu-single-vfpv4-d16.s
@@ -0,0 +1,14 @@
+@ Check a single .fpu directive.
+
+@ RUN: llvm-mc -triple arm-eabi -filetype obj %s \
+@ RUN:   | llvm-readobj --arch-specific - \
+@ RUN:   | FileCheck %s -check-prefix CHECK-ATTR
+
+  .fpu vfpv4-d16
+
+@ CHECK-ATTR: FileAttributes {
+@ CHECK-ATTR:   Attribute {
+@ CHECK-ATTR:     TagName: FP_arch
+@ CHECK-ATTR:     Description: VFPv4-D16
+@ CHECK-ATTR:   }
+@ CHECK-ATTR: }
\ No newline at end of file
diff --git a/llvm/test/MC/ARM/directive-fpu-single-vfpv4.s b/llvm/test/MC/ARM/directive-fpu-single-vfpv4.s
new file mode 100644
index 00000000000000..cc4e1d8c8bebe3
--- /dev/null
+++ b/llvm/test/MC/ARM/directive-fpu-single-vfpv4.s
@@ -0,0 +1,14 @@
+@ Check a single .fpu directive.
+
+@ RUN: llvm-mc -triple arm-eabi -filetype obj %s \
+@ RUN:   | llvm-readobj --arch-specific - \
+@ RUN:   | FileCheck %s -check-prefix CHECK-ATTR
+
+  .fpu vfpv4
+
+@ CHECK-ATTR: FileAttributes {
+@ CHECK-ATTR:   Attribute {
+@ CHECK-ATTR:     TagName: FP_arch
+@ CHECK-ATTR:     Description: VFPv4
+@ CHECK-ATTR:   }
+@ CHECK-ATTR: }
\ No newline at end of file

>From 22a940e0ae85c0902acb76ddf1fbb1a01786c65b Mon Sep 17 00:00:00 2001
From: Rodolfo Wottrich <rodolfo.wottrich at arm.com>
Date: Thu, 22 Aug 2024 16:10:25 +0100
Subject: [PATCH 2/2] [ARM] Fix file endings in the previous commit

---
 llvm/test/MC/ARM/directive-fpu-single-crypto-neon-fp-armv8.s   | 3 ++-
 llvm/test/MC/ARM/directive-fpu-single-fp-armv8-fullfp16-d16.s  | 3 ++-
 .../MC/ARM/directive-fpu-single-fp-armv8-fullfp16-sp-d16.s     | 3 ++-
 llvm/test/MC/ARM/directive-fpu-single-fp-armv8.s               | 3 ++-
 llvm/test/MC/ARM/directive-fpu-single-fpv4-sp-d16.s            | 3 ++-
 llvm/test/MC/ARM/directive-fpu-single-fpv5-d16.s               | 3 ++-
 llvm/test/MC/ARM/directive-fpu-single-fpv5-sp-d16.s            | 3 ++-
 llvm/test/MC/ARM/directive-fpu-single-neon-fp-armv8.s          | 3 ++-
 llvm/test/MC/ARM/directive-fpu-single-neon-fp16.s              | 3 ++-
 llvm/test/MC/ARM/directive-fpu-single-neon-vfpv4.s             | 3 ++-
 llvm/test/MC/ARM/directive-fpu-single-neon.s                   | 3 ++-
 llvm/test/MC/ARM/directive-fpu-single-none.s                   | 3 ++-
 llvm/test/MC/ARM/directive-fpu-single-vfp.s                    | 3 ++-
 llvm/test/MC/ARM/directive-fpu-single-vfpv2.s                  | 3 ++-
 llvm/test/MC/ARM/directive-fpu-single-vfpv3-d16-fp16.s         | 3 ++-
 llvm/test/MC/ARM/directive-fpu-single-vfpv3-d16.s              | 3 ++-
 llvm/test/MC/ARM/directive-fpu-single-vfpv3-fp16.s             | 3 ++-
 llvm/test/MC/ARM/directive-fpu-single-vfpv3.s                  | 3 ++-
 llvm/test/MC/ARM/directive-fpu-single-vfpv3xd-fp16.s           | 3 ++-
 llvm/test/MC/ARM/directive-fpu-single-vfpv3xd.s                | 3 ++-
 llvm/test/MC/ARM/directive-fpu-single-vfpv4-d16.s              | 3 ++-
 llvm/test/MC/ARM/directive-fpu-single-vfpv4.s                  | 3 ++-
 22 files changed, 44 insertions(+), 22 deletions(-)

diff --git a/llvm/test/MC/ARM/directive-fpu-single-crypto-neon-fp-armv8.s b/llvm/test/MC/ARM/directive-fpu-single-crypto-neon-fp-armv8.s
index ea423f01c37fbc..58af1cbf41513d 100644
--- a/llvm/test/MC/ARM/directive-fpu-single-crypto-neon-fp-armv8.s
+++ b/llvm/test/MC/ARM/directive-fpu-single-crypto-neon-fp-armv8.s
@@ -11,4 +11,5 @@
 @ CHECK-ATTR:     TagName: FP_arch
 @ CHECK-ATTR:     Description: ARMv8-a FP
 @ CHECK-ATTR:   }
-@ CHECK-ATTR: }
\ No newline at end of file
+@ CHECK-ATTR: }
+
diff --git a/llvm/test/MC/ARM/directive-fpu-single-fp-armv8-fullfp16-d16.s b/llvm/test/MC/ARM/directive-fpu-single-fp-armv8-fullfp16-d16.s
index 652c5ce3aea76b..11e1f6b51d9aa8 100644
--- a/llvm/test/MC/ARM/directive-fpu-single-fp-armv8-fullfp16-d16.s
+++ b/llvm/test/MC/ARM/directive-fpu-single-fp-armv8-fullfp16-d16.s
@@ -11,4 +11,5 @@
 @ CHECK-ATTR:     TagName: FP_arch
 @ CHECK-ATTR:     Description: ARMv8-a FP-D16
 @ CHECK-ATTR:   }
-@ CHECK-ATTR: }
\ No newline at end of file
+@ CHECK-ATTR: }
+
diff --git a/llvm/test/MC/ARM/directive-fpu-single-fp-armv8-fullfp16-sp-d16.s b/llvm/test/MC/ARM/directive-fpu-single-fp-armv8-fullfp16-sp-d16.s
index c88c8e0d2e2697..6307deb0de400d 100644
--- a/llvm/test/MC/ARM/directive-fpu-single-fp-armv8-fullfp16-sp-d16.s
+++ b/llvm/test/MC/ARM/directive-fpu-single-fp-armv8-fullfp16-sp-d16.s
@@ -11,4 +11,5 @@
 @ CHECK-ATTR:     TagName: FP_arch
 @ CHECK-ATTR:     Description: ARMv8-a FP-D16
 @ CHECK-ATTR:   }
-@ CHECK-ATTR: }
\ No newline at end of file
+@ CHECK-ATTR: }
+
diff --git a/llvm/test/MC/ARM/directive-fpu-single-fp-armv8.s b/llvm/test/MC/ARM/directive-fpu-single-fp-armv8.s
index dcacb22c934b60..48eb342849c933 100644
--- a/llvm/test/MC/ARM/directive-fpu-single-fp-armv8.s
+++ b/llvm/test/MC/ARM/directive-fpu-single-fp-armv8.s
@@ -11,4 +11,5 @@
 @ CHECK-ATTR:     TagName: FP_arch
 @ CHECK-ATTR:     Description: ARMv8-a FP
 @ CHECK-ATTR:   }
-@ CHECK-ATTR: }
\ No newline at end of file
+@ CHECK-ATTR: }
+
diff --git a/llvm/test/MC/ARM/directive-fpu-single-fpv4-sp-d16.s b/llvm/test/MC/ARM/directive-fpu-single-fpv4-sp-d16.s
index 97a12d68c1fa1e..e1e64c10cc3f79 100644
--- a/llvm/test/MC/ARM/directive-fpu-single-fpv4-sp-d16.s
+++ b/llvm/test/MC/ARM/directive-fpu-single-fpv4-sp-d16.s
@@ -11,4 +11,5 @@
 @ CHECK-ATTR:     TagName: FP_arch
 @ CHECK-ATTR:     Description: VFPv4-D16
 @ CHECK-ATTR:   }
-@ CHECK-ATTR: }
\ No newline at end of file
+@ CHECK-ATTR: }
+
diff --git a/llvm/test/MC/ARM/directive-fpu-single-fpv5-d16.s b/llvm/test/MC/ARM/directive-fpu-single-fpv5-d16.s
index 1965107d3e78cc..dc03f7a709c9b5 100644
--- a/llvm/test/MC/ARM/directive-fpu-single-fpv5-d16.s
+++ b/llvm/test/MC/ARM/directive-fpu-single-fpv5-d16.s
@@ -11,4 +11,5 @@
 @ CHECK-ATTR:     TagName: FP_arch
 @ CHECK-ATTR:     Description: ARMv8-a FP-D16
 @ CHECK-ATTR:   }
-@ CHECK-ATTR: }
\ No newline at end of file
+@ CHECK-ATTR: }
+
diff --git a/llvm/test/MC/ARM/directive-fpu-single-fpv5-sp-d16.s b/llvm/test/MC/ARM/directive-fpu-single-fpv5-sp-d16.s
index e362c1af18f5a1..850db4da120e26 100644
--- a/llvm/test/MC/ARM/directive-fpu-single-fpv5-sp-d16.s
+++ b/llvm/test/MC/ARM/directive-fpu-single-fpv5-sp-d16.s
@@ -11,4 +11,5 @@
 @ CHECK-ATTR:     TagName: FP_arch
 @ CHECK-ATTR:     Description: ARMv8-a FP-D16
 @ CHECK-ATTR:   }
-@ CHECK-ATTR: }
\ No newline at end of file
+@ CHECK-ATTR: }
+
diff --git a/llvm/test/MC/ARM/directive-fpu-single-neon-fp-armv8.s b/llvm/test/MC/ARM/directive-fpu-single-neon-fp-armv8.s
index 6991738c09fb94..f84d6cf5cc1132 100644
--- a/llvm/test/MC/ARM/directive-fpu-single-neon-fp-armv8.s
+++ b/llvm/test/MC/ARM/directive-fpu-single-neon-fp-armv8.s
@@ -11,4 +11,5 @@
 @ CHECK-ATTR:     TagName: FP_arch
 @ CHECK-ATTR:     Description: ARMv8-a FP
 @ CHECK-ATTR:   }
-@ CHECK-ATTR: }
\ No newline at end of file
+@ CHECK-ATTR: }
+
diff --git a/llvm/test/MC/ARM/directive-fpu-single-neon-fp16.s b/llvm/test/MC/ARM/directive-fpu-single-neon-fp16.s
index 8bf0750fa84234..fc7520ce8bb75f 100644
--- a/llvm/test/MC/ARM/directive-fpu-single-neon-fp16.s
+++ b/llvm/test/MC/ARM/directive-fpu-single-neon-fp16.s
@@ -11,4 +11,5 @@
 @ CHECK-ATTR:     TagName: FP_arch
 @ CHECK-ATTR:     Description: VFPv3
 @ CHECK-ATTR:   }
-@ CHECK-ATTR: }
\ No newline at end of file
+@ CHECK-ATTR: }
+
diff --git a/llvm/test/MC/ARM/directive-fpu-single-neon-vfpv4.s b/llvm/test/MC/ARM/directive-fpu-single-neon-vfpv4.s
index 02d77a8814a24d..5c56022f66ac9a 100644
--- a/llvm/test/MC/ARM/directive-fpu-single-neon-vfpv4.s
+++ b/llvm/test/MC/ARM/directive-fpu-single-neon-vfpv4.s
@@ -11,4 +11,5 @@
 @ CHECK-ATTR:     TagName: FP_arch
 @ CHECK-ATTR:     Description: VFPv4
 @ CHECK-ATTR:   }
-@ CHECK-ATTR: }
\ No newline at end of file
+@ CHECK-ATTR: }
+
diff --git a/llvm/test/MC/ARM/directive-fpu-single-neon.s b/llvm/test/MC/ARM/directive-fpu-single-neon.s
index 17c2b17572998a..676ed11a14bd03 100644
--- a/llvm/test/MC/ARM/directive-fpu-single-neon.s
+++ b/llvm/test/MC/ARM/directive-fpu-single-neon.s
@@ -11,4 +11,5 @@
 @ CHECK-ATTR:     TagName: FP_arch
 @ CHECK-ATTR:     Description: VFPv3
 @ CHECK-ATTR:   }
-@ CHECK-ATTR: }
\ No newline at end of file
+@ CHECK-ATTR: }
+
diff --git a/llvm/test/MC/ARM/directive-fpu-single-none.s b/llvm/test/MC/ARM/directive-fpu-single-none.s
index c33d0b642e1f41..aa8df756e3a080 100644
--- a/llvm/test/MC/ARM/directive-fpu-single-none.s
+++ b/llvm/test/MC/ARM/directive-fpu-single-none.s
@@ -6,4 +6,5 @@
 
   .fpu none
 
-@ CHECK-ATTR-NOT:     TagName: FP_arch
\ No newline at end of file
+@ CHECK-ATTR-NOT:     TagName: FP_arch
+
diff --git a/llvm/test/MC/ARM/directive-fpu-single-vfp.s b/llvm/test/MC/ARM/directive-fpu-single-vfp.s
index e3b2ea50cfa107..2023236ecf61d5 100644
--- a/llvm/test/MC/ARM/directive-fpu-single-vfp.s
+++ b/llvm/test/MC/ARM/directive-fpu-single-vfp.s
@@ -11,4 +11,5 @@
 @ CHECK-ATTR:     TagName: FP_arch
 @ CHECK-ATTR:     Description: VFPv2
 @ CHECK-ATTR:   }
-@ CHECK-ATTR: }
\ No newline at end of file
+@ CHECK-ATTR: }
+
diff --git a/llvm/test/MC/ARM/directive-fpu-single-vfpv2.s b/llvm/test/MC/ARM/directive-fpu-single-vfpv2.s
index ebbe521abe58d8..7c4d6b37e2b612 100644
--- a/llvm/test/MC/ARM/directive-fpu-single-vfpv2.s
+++ b/llvm/test/MC/ARM/directive-fpu-single-vfpv2.s
@@ -11,4 +11,5 @@
 @ CHECK-ATTR:     TagName: FP_arch
 @ CHECK-ATTR:     Description: VFPv2
 @ CHECK-ATTR:   }
-@ CHECK-ATTR: }
\ No newline at end of file
+@ CHECK-ATTR: }
+
diff --git a/llvm/test/MC/ARM/directive-fpu-single-vfpv3-d16-fp16.s b/llvm/test/MC/ARM/directive-fpu-single-vfpv3-d16-fp16.s
index 83b11db50d22ed..adc8cb276190a0 100644
--- a/llvm/test/MC/ARM/directive-fpu-single-vfpv3-d16-fp16.s
+++ b/llvm/test/MC/ARM/directive-fpu-single-vfpv3-d16-fp16.s
@@ -11,4 +11,5 @@
 @ CHECK-ATTR:     TagName: FP_arch
 @ CHECK-ATTR:     Description: VFPv3-D16
 @ CHECK-ATTR:   }
-@ CHECK-ATTR: }
\ No newline at end of file
+@ CHECK-ATTR: }
+
diff --git a/llvm/test/MC/ARM/directive-fpu-single-vfpv3-d16.s b/llvm/test/MC/ARM/directive-fpu-single-vfpv3-d16.s
index d6eb7b9eab0056..a33e1df3f48427 100644
--- a/llvm/test/MC/ARM/directive-fpu-single-vfpv3-d16.s
+++ b/llvm/test/MC/ARM/directive-fpu-single-vfpv3-d16.s
@@ -11,4 +11,5 @@
 @ CHECK-ATTR:     TagName: FP_arch
 @ CHECK-ATTR:     Description: VFPv3-D16
 @ CHECK-ATTR:   }
-@ CHECK-ATTR: }
\ No newline at end of file
+@ CHECK-ATTR: }
+
diff --git a/llvm/test/MC/ARM/directive-fpu-single-vfpv3-fp16.s b/llvm/test/MC/ARM/directive-fpu-single-vfpv3-fp16.s
index fbf3a2c95ef33c..5238e56bcf1f3a 100644
--- a/llvm/test/MC/ARM/directive-fpu-single-vfpv3-fp16.s
+++ b/llvm/test/MC/ARM/directive-fpu-single-vfpv3-fp16.s
@@ -11,4 +11,5 @@
 @ CHECK-ATTR:     TagName: FP_arch
 @ CHECK-ATTR:     Description: VFPv3
 @ CHECK-ATTR:   }
-@ CHECK-ATTR: }
\ No newline at end of file
+@ CHECK-ATTR: }
+
diff --git a/llvm/test/MC/ARM/directive-fpu-single-vfpv3.s b/llvm/test/MC/ARM/directive-fpu-single-vfpv3.s
index a8b32d6b1e4ecc..6182b88ba3f9d9 100644
--- a/llvm/test/MC/ARM/directive-fpu-single-vfpv3.s
+++ b/llvm/test/MC/ARM/directive-fpu-single-vfpv3.s
@@ -11,4 +11,5 @@
 @ CHECK-ATTR:     TagName: FP_arch
 @ CHECK-ATTR:     Description: VFPv3
 @ CHECK-ATTR:   }
-@ CHECK-ATTR: }
\ No newline at end of file
+@ CHECK-ATTR: }
+
diff --git a/llvm/test/MC/ARM/directive-fpu-single-vfpv3xd-fp16.s b/llvm/test/MC/ARM/directive-fpu-single-vfpv3xd-fp16.s
index 4e6e909dbc644c..6e91c565199db4 100644
--- a/llvm/test/MC/ARM/directive-fpu-single-vfpv3xd-fp16.s
+++ b/llvm/test/MC/ARM/directive-fpu-single-vfpv3xd-fp16.s
@@ -11,4 +11,5 @@
 @ CHECK-ATTR:     TagName: FP_arch
 @ CHECK-ATTR:     Description: VFPv3-D16
 @ CHECK-ATTR:   }
-@ CHECK-ATTR: }
\ No newline at end of file
+@ CHECK-ATTR: }
+
diff --git a/llvm/test/MC/ARM/directive-fpu-single-vfpv3xd.s b/llvm/test/MC/ARM/directive-fpu-single-vfpv3xd.s
index ae1d064df450e9..57e9b5379d9664 100644
--- a/llvm/test/MC/ARM/directive-fpu-single-vfpv3xd.s
+++ b/llvm/test/MC/ARM/directive-fpu-single-vfpv3xd.s
@@ -11,4 +11,5 @@
 @ CHECK-ATTR:     TagName: FP_arch
 @ CHECK-ATTR:     Description: VFPv3-D16
 @ CHECK-ATTR:   }
-@ CHECK-ATTR: }
\ No newline at end of file
+@ CHECK-ATTR: }
+
diff --git a/llvm/test/MC/ARM/directive-fpu-single-vfpv4-d16.s b/llvm/test/MC/ARM/directive-fpu-single-vfpv4-d16.s
index 8626dbea7fee91..604c4c2e941895 100644
--- a/llvm/test/MC/ARM/directive-fpu-single-vfpv4-d16.s
+++ b/llvm/test/MC/ARM/directive-fpu-single-vfpv4-d16.s
@@ -11,4 +11,5 @@
 @ CHECK-ATTR:     TagName: FP_arch
 @ CHECK-ATTR:     Description: VFPv4-D16
 @ CHECK-ATTR:   }
-@ CHECK-ATTR: }
\ No newline at end of file
+@ CHECK-ATTR: }
+
diff --git a/llvm/test/MC/ARM/directive-fpu-single-vfpv4.s b/llvm/test/MC/ARM/directive-fpu-single-vfpv4.s
index cc4e1d8c8bebe3..41c043a66b474c 100644
--- a/llvm/test/MC/ARM/directive-fpu-single-vfpv4.s
+++ b/llvm/test/MC/ARM/directive-fpu-single-vfpv4.s
@@ -11,4 +11,5 @@
 @ CHECK-ATTR:     TagName: FP_arch
 @ CHECK-ATTR:     Description: VFPv4
 @ CHECK-ATTR:   }
-@ CHECK-ATTR: }
\ No newline at end of file
+@ CHECK-ATTR: }
+



More information about the llvm-commits mailing list