]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
arm: testsuite: fix vgetq_lane tests for c++
authorChristophe Lyon <christophe.lyon@linaro.org>
Mon, 17 Nov 2025 11:05:10 +0000 (11:05 +0000)
committerChristophe Lyon <christophe.lyon@linaro.org>
Wed, 19 Nov 2025 12:17:01 +0000 (12:17 +0000)
Surpringly these tests were lacking the extern "C" that other MVE
intrinsics have, making them fail when tested in C++ mode.

While fixing that:
- remove useless dg-skip-if
- remove hardcoded -mfloat-abi=hard from s64 and u64 versions
- add check-function-bodies to s64 and u64 versions, such that these
  tests no longer appear as duplicates.

gcc/testsuite/ChangeLog:
* gcc.target/arm/mve/intrinsics/vgetq_lane_f16.c: Add missing
extern "C". Remove dg-skip-if.
* gcc.target/arm/mve/intrinsics/vgetq_lane_f32.c: Likewise.
* gcc.target/arm/mve/intrinsics/vgetq_lane_s16.c: Likewise.
* gcc.target/arm/mve/intrinsics/vgetq_lane_s32.c: Likewise.
* gcc.target/arm/mve/intrinsics/vgetq_lane_s8.c: Likewise.
* gcc.target/arm/mve/intrinsics/vgetq_lane_u16.c: Likewise.
* gcc.target/arm/mve/intrinsics/vgetq_lane_u32.c: Likewise.
* gcc.target/arm/mve/intrinsics/vgetq_lane_u8.c: Likewise.
* gcc.target/arm/mve/intrinsics/vgetq_lane_s64.c: Likewise. Add
check-function-bodies.
* gcc.target/arm/mve/intrinsics/vgetq_lane_u64.c: Likewise.

gcc/testsuite/gcc.target/arm/mve/intrinsics/vgetq_lane_f16.c
gcc/testsuite/gcc.target/arm/mve/intrinsics/vgetq_lane_f32.c
gcc/testsuite/gcc.target/arm/mve/intrinsics/vgetq_lane_s16.c
gcc/testsuite/gcc.target/arm/mve/intrinsics/vgetq_lane_s32.c
gcc/testsuite/gcc.target/arm/mve/intrinsics/vgetq_lane_s64.c
gcc/testsuite/gcc.target/arm/mve/intrinsics/vgetq_lane_s8.c
gcc/testsuite/gcc.target/arm/mve/intrinsics/vgetq_lane_u16.c
gcc/testsuite/gcc.target/arm/mve/intrinsics/vgetq_lane_u32.c
gcc/testsuite/gcc.target/arm/mve/intrinsics/vgetq_lane_u64.c
gcc/testsuite/gcc.target/arm/mve/intrinsics/vgetq_lane_u8.c

index b0811372dc71137e2ec51975d8947599f7263b18..4bcc2abb84bf6b2f409c7de54b5da8f1b27b4ff5 100644 (file)
@@ -1,4 +1,3 @@
-/* { dg-skip-if "Incompatible float ABI" { *-*-* } { "-mfloat-abi=soft" } {""} } */
 /* { dg-require-effective-target arm_v8_1m_mve_fp_ok } */
 /* { dg-add-options arm_v8_1m_mve_fp } */
 /* { dg-additional-options "-O2" } */
@@ -6,6 +5,10 @@
 
 #include "arm_mve.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 float16_t
 foo (float16x8_t a)
 {
@@ -45,3 +48,7 @@ foo1 (float16x8_t a)
 ** )
 **     bx\tlr
 */
+
+#ifdef __cplusplus
+}
+#endif
index c923b9ecf2607bdaf4bb4c8a2859c2a3fdc61e86..18d2dfd5a5883b6d12de01441594b0c2cafa70f8 100644 (file)
@@ -1,4 +1,3 @@
-/* { dg-skip-if "Incompatible float ABI" { *-*-* } { "-mfloat-abi=soft" } {""} } */
 /* { dg-require-effective-target arm_v8_1m_mve_fp_ok } */
 /* { dg-add-options arm_v8_1m_mve_fp } */
 /* { dg-additional-options "-O2" } */
@@ -6,6 +5,10 @@
 
 #include "arm_mve.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 float32_t
 foo (float32x4_t a)
 {
@@ -45,3 +48,7 @@ foo1 (float32x4_t a)
 ** )
 **     bx\tlr
 */
+
+#ifdef __cplusplus
+}
+#endif
index 4a8963744f8f303aa868786f334f4eb75c7aba76..e8744b8c109a0e508c6727240df3717999412c62 100644 (file)
@@ -1,4 +1,3 @@
-/* { dg-skip-if "Incompatible float ABI" { *-*-* } { "-mfloat-abi=soft" } {""} } */
 /* { dg-require-effective-target arm_v8_1m_mve_ok } */
 /* { dg-add-options arm_v8_1m_mve } */
 /* { dg-additional-options "-O2" } */
@@ -6,6 +5,10 @@
 
 #include "arm_mve.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 int16_t
 foo (int16x8_t a)
 {
@@ -43,3 +46,7 @@ foo1 (int16x8_t a)
 ** )
 **     bx\tlr
 */
+
+#ifdef __cplusplus
+}
+#endif
index 3a504e84382e3103d89c30dcaa0b7bdf8206a1fd..e6ac370fe96662297da302739127b2e5470189e4 100644 (file)
@@ -1,4 +1,3 @@
-/* { dg-skip-if "Incompatible float ABI" { *-*-* } { "-mfloat-abi=soft" } {""} } */
 /* { dg-require-effective-target arm_v8_1m_mve_ok } */
 /* { dg-add-options arm_v8_1m_mve } */
 /* { dg-additional-options "-O2" } */
@@ -6,6 +5,10 @@
 
 #include "arm_mve.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 int32_t
 foo (int32x4_t a)
 {
@@ -43,3 +46,7 @@ foo1 (int32x4_t a)
 ** )
 **     bx\tlr
 */
+
+#ifdef __cplusplus
+}
+#endif
index 63b25088eeea01acf8885d295170b7f245acfc94..857ed76655b1ad1d2b3b863703514a5f392967f0 100644 (file)
@@ -1,23 +1,48 @@
-/* { dg-skip-if "Incompatible float ABI" { *-*-* } { "-mfloat-abi=soft" } {""} } */
-/* { dg-require-effective-target arm_hard_ok } */
 /* { dg-require-effective-target arm_v8_1m_mve_ok } */
 /* { dg-add-options arm_v8_1m_mve } */
-/* { dg-additional-options "-mfloat-abi=hard -O2" } */
+/* { dg-additional-options "-O2" } */
+/* { dg-final { check-function-bodies "**" "" "" } } */
 
 #include "arm_mve.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 int64_t
 foo (int64x2_t a)
 {
   return vgetq_lane_s64 (a, 0);
 }
-
-/* { dg-final { scan-assembler {vmov\tr0, r1, d0}  }  } */
+/*
+** foo:
+** (
+       -mfloat-abi=softfp
+       no operation needed
+** |
+       -mfloat-abi=hard
+**     vmov\tr0, r1, d0\t@ int
+** )
+**     bx\tlr
+*/
 
 int64_t
 foo1 (int64x2_t a)
 {
   return vgetq_lane (a, 0);
 }
+/*
+** foo1:
+** (
+       -mfloat-abi=softfp
+       no operation needed
+** |
+       -mfloat-abi=hard
+**     vmov\tr0, r1, d0\t@ int
+** )
+**     bx\tlr
+*/
 
-/* { dg-final { scan-assembler {vmov\tr0, r1, d0}  }  } */
+#ifdef __cplusplus
+}
+#endif
index cd014b288774fba882067b6546d9c94a9831403e..b342af57d24341b3a961ebd2f4c27961c5eff352 100644 (file)
@@ -1,4 +1,3 @@
-/* { dg-skip-if "Incompatible float ABI" { *-*-* } { "-mfloat-abi=soft" } {""} } */
 /* { dg-require-effective-target arm_v8_1m_mve_ok } */
 /* { dg-add-options arm_v8_1m_mve } */
 /* { dg-additional-options "-O2" } */
@@ -6,6 +5,10 @@
 
 #include "arm_mve.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 int8_t
 foo (int8x16_t a)
 {
@@ -43,3 +46,7 @@ foo1 (int8x16_t a)
 ** )
 **     bx\tlr
 */
+
+#ifdef __cplusplus
+}
+#endif
index 74b734051d41fe855a9b6da0095fae06630cbf71..4b420116d7f2626def164425780ddc4627aed986 100644 (file)
@@ -1,4 +1,3 @@
-/* { dg-skip-if "Incompatible float ABI" { *-*-* } { "-mfloat-abi=soft" } {""} } */
 /* { dg-require-effective-target arm_v8_1m_mve_ok } */
 /* { dg-add-options arm_v8_1m_mve } */
 /* { dg-additional-options "-O2" } */
@@ -6,6 +5,10 @@
 
 #include "arm_mve.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 uint16_t
 foo (uint16x8_t a)
 {
@@ -43,3 +46,7 @@ foo1 (uint16x8_t a)
 ** )
 **     bx\tlr
 */
+
+#ifdef __cplusplus
+}
+#endif
index c4460e44b9ab2e3aaa40c278b0c1466f105e3296..05e0bda8f2356b797ac8f5934a2d1555166ffd9e 100644 (file)
@@ -1,4 +1,3 @@
-/* { dg-skip-if "Incompatible float ABI" { *-*-* } { "-mfloat-abi=soft" } {""} } */
 /* { dg-require-effective-target arm_v8_1m_mve_ok } */
 /* { dg-add-options arm_v8_1m_mve } */
 /* { dg-additional-options "-O2" } */
@@ -6,6 +5,10 @@
 
 #include "arm_mve.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 uint32_t
 foo (uint32x4_t a)
 {
@@ -43,3 +46,7 @@ foo1 (uint32x4_t a)
 ** )
 **     bx\tlr
 */
+
+#ifdef __cplusplus
+}
+#endif
index a4b900fc66bfd6e06588473aa0a59f3cb3a3ec0a..7c708d541e383cb38a0d7a6efeda259ac272f876 100644 (file)
@@ -1,23 +1,48 @@
-/* { dg-skip-if "Incompatible float ABI" { *-*-* } { "-mfloat-abi=soft" } {""} } */
-/* { dg-require-effective-target arm_hard_ok } */
 /* { dg-require-effective-target arm_v8_1m_mve_ok } */
 /* { dg-add-options arm_v8_1m_mve } */
-/* { dg-additional-options "-mfloat-abi=hard -O2" } */
+/* { dg-additional-options "-O2" } */
+/* { dg-final { check-function-bodies "**" "" "" } } */
 
 #include "arm_mve.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 uint64_t
 foo (uint64x2_t a)
 {
   return vgetq_lane_u64 (a, 0);
 }
-
-/* { dg-final { scan-assembler {vmov\tr0, r1, d0}  }  } */
+/*
+** foo:
+** (
+       -mfloat-abi=softfp
+       no operation needed
+** |
+       -mfloat-abi=hard
+**     vmov\tr0, r1, d0\t@ int
+** )
+**     bx\tlr
+*/
 
 uint64_t
 foo1 (uint64x2_t a)
 {
   return vgetq_lane (a, 0);
 }
+/*
+** foo1:
+** (
+       -mfloat-abi=softfp
+       no operation needed
+** |
+       -mfloat-abi=hard
+**     vmov\tr0, r1, d0\t@ int
+** )
+**     bx\tlr
+*/
 
-/* { dg-final { scan-assembler {vmov\tr0, r1, d0}  }  } */
+#ifdef __cplusplus
+}
+#endif
index f3abf1e9c5665fb826e537045d5c9d978acf2497..b86764fe97819a2a8628a2e16e2de499fa58a569 100644 (file)
@@ -1,4 +1,3 @@
-/* { dg-skip-if "Incompatible float ABI" { *-*-* } { "-mfloat-abi=soft" } {""} } */
 /* { dg-require-effective-target arm_v8_1m_mve_ok } */
 /* { dg-add-options arm_v8_1m_mve } */
 /* { dg-additional-options "-O2" } */
@@ -6,6 +5,10 @@
 
 #include "arm_mve.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 uint8_t
 foo (uint8x16_t a)
 {
@@ -43,3 +46,7 @@ foo1 (uint8x16_t a)
 ** )
 **     bx\tlr
 */
+
+#ifdef __cplusplus
+}
+#endif