]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
testsuite: Remove -O options from some mips.exp tests
authorRichard Sandiford <rdsandiford@googlemail.com>
Tue, 10 Mar 2026 12:05:56 +0000 (12:05 +0000)
committerRichard Sandiford <rdsandiford@googlemail.com>
Tue, 10 Mar 2026 12:05:56 +0000 (12:05 +0000)
Running mips.exp generated several errors like:

ERROR: gcc.target/mips/pr118608-1.c   -O0 : Unrecognised option: -O2 for " dg-options 2 "-mabi=64 -O2" "

mips.exp overrides dg-options with some logic to (try to) enable
the transitive closure of features that would be needed to make the
dg-options valid for the current test run, downgrading from run to
assemble to compile as neecessary.  In order to make sure that
every relevant option has been considered, this version of dg-options
errors out for things that it doesn't recognise.

-O options aren't in the list because mips.exp cycles through the usual
optimisation options.  Instead, dg-skips are used if the test doesn't
make sense for a particular -O* option.

Removing the -O options makes pr118608-2.c identical to pr118608-1.c
and pr118608-4.c identical to pr118608-3.c.

gcc/testsuite/
* gcc.target/mips/pr118608-2.c: Delete.
* gcc.target/mips/pr118608-4.c: Likewise.
* gcc.target/mips/pr123833.c: Remove -O* option.
* gcc.target/mips/pr118608-1.c: Likewise.
* gcc.target/mips/pr118608-3.c: Likewise, and rename to pr118608-2.c.

gcc/testsuite/gcc.target/mips/pr118608-1.c
gcc/testsuite/gcc.target/mips/pr118608-2.c
gcc/testsuite/gcc.target/mips/pr118608-3.c [deleted file]
gcc/testsuite/gcc.target/mips/pr118608-4.c [deleted file]
gcc/testsuite/gcc.target/mips/pr123833.c

index e7384d7137d89904f19373358c994cc4cf7dd6a4..9604b38059e55278559ee9ebf157d6650af4d7e9 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do run } */
-/* { dg-options "-mabi=64 -O2" } */
+/* { dg-options "-mabi=64" } */
 
 #define COUNT 10
 
index a5bcfda6ca136786c69658bd0a9b236140c94452..d4c3908174d0354ee7a39dc95847c5212af5cba7 100644 (file)
@@ -1,5 +1,5 @@
-/* { dg-do run } */
-/* { dg-options "-mabi=64 -Os" } */
+/* { dg-do compile } */
+/* { dg-options "-mabi=64 -march=octeon2" } */
 
 #define COUNT 10
 
diff --git a/gcc/testsuite/gcc.target/mips/pr118608-3.c b/gcc/testsuite/gcc.target/mips/pr118608-3.c
deleted file mode 100644 (file)
index f017e4e..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-mabi=64 -O2 -march=octeon2" } */
-
-#define COUNT 10
-
-typedef unsigned short u16;
-typedef unsigned int   u32;
-
-typedef struct NeedleAddress
-{
-  u16   nId;
-  u16   mId;
-} NeedleAddress;
-
-u32 __attribute__ ((noinline)) prepareNeedle(const u16 upper, const u16 lower)
-{
-    u32 needleAddress = 0;
-    NeedleAddress *const addr = (NeedleAddress*)(&needleAddress);
-    addr->mId = upper;
-    addr->nId = lower;
-    return needleAddress;
-}
-
-const u32* __attribute__ ((noinline)) findNeedle(const u32 needle, const u32* begin, const u32* end)
-{
-    while ( begin != end && needle != *begin )
-    {
-        ++begin;
-    }
-    return begin;
-}
-
-int main()
-{
-    u32 needle = prepareNeedle(0xDCBA, 0xABCD);
-
-    u32 haystack[COUNT] = {};
-    for (int i = 0; i < COUNT; i++)
-        haystack[i] = needle;
-
-    const u32* result = findNeedle(needle, haystack, haystack + COUNT);
-    if (result == haystack + COUNT)
-        __builtin_abort ();
-    return 0;
-}
diff --git a/gcc/testsuite/gcc.target/mips/pr118608-4.c b/gcc/testsuite/gcc.target/mips/pr118608-4.c
deleted file mode 100644 (file)
index 4c96e37..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-mabi=64 -Os -march=octeon2" } */
-
-#define COUNT 10
-
-typedef unsigned short u16;
-typedef unsigned int   u32;
-
-typedef struct NeedleAddress
-{
-  u16   nId;
-  u16   mId;
-} NeedleAddress;
-
-u32 __attribute__ ((noinline)) prepareNeedle(const u16 upper, const u16 lower)
-{
-    u32 needleAddress = 0;
-    NeedleAddress *const addr = (NeedleAddress*)(&needleAddress);
-    addr->mId = upper;
-    addr->nId = lower;
-    return needleAddress;
-}
-
-const u32* __attribute__ ((noinline)) findNeedle(const u32 needle, const u32* begin, const u32* end)
-{
-    while ( begin != end && needle != *begin )
-    {
-        ++begin;
-    }
-    return begin;
-}
-
-int main()
-{
-    u32 needle = prepareNeedle(0xDCBA, 0xABCD);
-
-    u32 haystack[COUNT] = {};
-    for (int i = 0; i < COUNT; i++)
-        haystack[i] = needle;
-
-    const u32* result = findNeedle(needle, haystack, haystack + COUNT);
-    if (result == haystack + COUNT)
-        __builtin_abort ();
-    return 0;
-}
index 4d0c9e8eaece438d21310b72c0c5b1c0de5c56e2..a3d7e4f97f36942554e40a781b41706222ba42b0 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O1 -mabi=64 -mhard-float" } */
+/* { dg-options "-mabi=64 -mhard-float" } */
 
 typedef short int16_t;
 typedef signed char int8_t;