]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
testsuite: Skip cases for default_packed targets
authorDimitar Dimitrov <dimitar@dinux.eu>
Fri, 15 Apr 2022 19:58:50 +0000 (22:58 +0300)
committerDimitar Dimitrov <dimitar@dinux.eu>
Tue, 3 May 2022 18:56:15 +0000 (21:56 +0300)
The memchr test cases expect padding to be present in structures.  But
this is not true for targets which pack by default.  Skip these test
cases in order to avoid static assert errors when checking field offsets.

gcc/testsuite/ChangeLog:

* gcc.dg/memchr.c: Skip for default_packed targets.
* gcc.dg/memcmp-3.c: Ditto.

Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
gcc/testsuite/gcc.dg/memchr.c
gcc/testsuite/gcc.dg/memcmp-3.c

index fb21d58b4761e3bc641e0c3ae207c8330e286d61..27524b825204fb80a54b1640630cbdd5345a9d6c 100644 (file)
@@ -1,6 +1,7 @@
 /* PR middle-end/78257 - missing memcmp optimization with constant arrays
    { dg-do compile }
-   { dg-options "-O -Wall -fdump-tree-optimized" } */
+   { dg-options "-O -Wall -fdump-tree-optimized" }
+   { dg-skip-if "test assumes structs are not packed" { default_packed } } */
 
 typedef __INT8_TYPE__  int8_t;
 typedef __INT16_TYPE__ int16_t;
index b5b8ac1209fd1f63cb29cc74a8627495f2166e17..8ddde996c2f66ea6c707c8dafce036303f51e4ff 100644 (file)
@@ -1,7 +1,8 @@
 /* PR middle-end/78257 - missing memcmp optimization with constant arrays
    { dg-do compile }
    { dg-options "-O -Wall -fdump-tree-optimized" }
-   { dg-skip-if "missing data representation" { "pdp11-*-*" } } */
+   { dg-skip-if "missing data representation" { "pdp11-*-*" } }
+   { dg-skip-if "test assumes structs are not packed" { default_packed } } */
 
 #define offsetof(T, m) __builtin_offsetof (T, m)