]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
arm: add test for recent combine fix [PR121773]
authorRichard Earnshaw <rearnsha@arm.com>
Wed, 7 Jan 2026 15:46:40 +0000 (15:46 +0000)
committerRichard Earnshaw <rearnsha@arm.com>
Wed, 7 Jan 2026 15:54:24 +0000 (15:54 +0000)
This adds and arm-specific executable test for the recent fix for PR
rtl-optimization/121773 based on the failing code in the original PR.

gcc/testsuite/ChangeLog:

PR rtl-optimization/121773
* gcc.target/arm/pr121773.c: New test.

gcc/testsuite/gcc.target/arm/pr121773.c [new file with mode: 0644]

diff --git a/gcc/testsuite/gcc.target/arm/pr121773.c b/gcc/testsuite/gcc.target/arm/pr121773.c
new file mode 100644 (file)
index 0000000..781cbd8
--- /dev/null
@@ -0,0 +1,19 @@
+/* { dg-do "run" } */
+/* { dg-require-effective-target arm_neon_hw } */
+/* { dg-options "-O2" } */
+/* { dg-add-options arm_neon } */
+
+#include <arm_neon.h>
+
+uint64x1_t __attribute__((noinline,noclone)) foo() {
+  uint64x2_t v36 = vdupq_n_u64(0x2020000012345678);
+  uint64x1_t v48 = vget_low_u64(v36);
+  uint64x1_t v50 = vadd_u64(v48, v48);
+  return vpadal_u32(v50, vdup_n_u32(0));
+}
+
+int main() {
+  if (vget_lane_u64 (foo(), 0) != 0x404000002468acf0)
+    __builtin_abort ();
+  return 0;
+}