]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[PATCH 21/61] Testsuite: Modify the gcc.dg/memcpy-4.c test
authorAndrew Bennett <andrew.bennett@imgtec.com>
Mon, 21 Apr 2025 15:56:47 +0000 (09:56 -0600)
committerJeff Law <jlaw@ventanamicro.com>
Mon, 21 Apr 2025 15:57:28 +0000 (09:57 -0600)
From: Andrew Bennett <andrew.bennett@imgtec.com>

Firstly, remove the MIPS specific bit of the test.
Secondly, create a MIPS specific version in the gcc.target/mips.
This will only execute for a MIPS ISA less than R6.

Cherry-picked c8b051cdbb1d5b166293513b0360d3d67cf31eb9
from https://github.com/MIPS/gcc

gcc/testsuite
* gcc.dg/memcpy-4.c: Remove mips specific code.
* gcc.target/mips/memcpy-2.c: New test.

gcc/testsuite/gcc.dg/memcpy-4.c
gcc/testsuite/gcc.target/mips/memcpy-2.c [new file with mode: 0644]

index 4c726f0ad74df1a46054a59f7615894eb06e50a3..b17b369c5c63f717c4a067d15358e557623fc501 100644 (file)
@@ -1,13 +1,8 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -fdump-rtl-expand" } */
+/* { dg-options "-O2" } */
 
-#ifdef __mips
-__attribute__((nomips16))
-#endif
 void
 f1 (char *p)
 {
   __builtin_memcpy (p, "12345", 5);
 }
-
-/* { dg-final { scan-rtl-dump "mem/u.*mem/u" "expand" { target mips*-*-* } } } */
diff --git a/gcc/testsuite/gcc.target/mips/memcpy-2.c b/gcc/testsuite/gcc.target/mips/memcpy-2.c
new file mode 100644 (file)
index 0000000..df0cd18
--- /dev/null
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "isa_rev<=5 -fdump-rtl-expand" } */
+/* { dg-skip-if "code quality test" { *-*-* } { "-Os" } { "" } } */
+
+__attribute__((nomips16))
+void
+f1 (char *p)
+{
+  __builtin_memcpy (p, "12345", 5);
+}
+
+/* { dg-final { scan-rtl-dump "mem/u.*mem/u" "expand" } } */