]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ifcombine field merge: adjust testcases [PR118025]
authorAlexandre Oliva <oliva@adacore.com>
Thu, 19 Dec 2024 01:17:08 +0000 (22:17 -0300)
committerAlexandre Oliva <oliva@gnu.org>
Thu, 19 Dec 2024 01:17:08 +0000 (22:17 -0300)
There was a thinko in the testcase field-merge-9.c: I overcorrected it
for big-endian.

As a bonus, I'm including stdbool.h in field-merge-12.c, because I
used bool without the header there.

for  gcc/testsuite/ChangeLog

PR testsuite/118025
* gcc.dg/field-merge-9.c (q): Drop overcorrection for
big-endian.
* gcc.dg/field-merge-12.c: Include stdbool.h.

gcc/testsuite/gcc.dg/field-merge-12.c
gcc/testsuite/gcc.dg/field-merge-9.c

index 7056eb607e904c8351bdac2444a73f24dd85538d..2c1e71ef6923593ceb3d51e67ab0cca2a7205e6d 100644 (file)
@@ -4,6 +4,8 @@
 /* Check that we don't crash when trying to handle masks that don't match the
    width of the original type.  */
 
+#include <stdbool.h>
+
 struct s {
   long long q;
 };
index b9e08d8fa37d2a2f0113921e0f03e6455dfe4942..04df54c2b74efece3ecff1e2447a82d0df9527d8 100644 (file)
@@ -17,9 +17,7 @@ struct s2 {
 static const char le = __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ ? 1 : 0;
 
 struct s1 p = { { -!le , -le }, 42 };
-struct s2 q = { (le
-                ? -2 << (__CHAR_BIT__ - 1)
-                : -1 & ((1 << (__CHAR_BIT__ - 1) << 1) - 1)), 42 };
+struct s2 q = { -2 << (__CHAR_BIT__ - 1), 42 };
 
 void f (void) {
   if (0