Applied more annotations to reduce testsuite fallout for 16-bit int / pointer targets.

https://gcc.gnu.org/r14-1074

Most of the affected tests use constants not suitable for 16-bit int, bit-fields wider than 16 bits, etc.

Johann

--

commit 9f5065094c9632a50bea604d5896a139609e50cf
Author: Georg-Johann Lay <a...@gjlay.de>
Date:   Mon May 22 16:47:56 2023 +0200

    testsuite/52641: Fix tests that fail for 16-bit int / pointer targets.

    gcc/testsuite/
            PR testsuite/52641
            * c-c++-common/pr19807-2.c: Use __SIZEOF_INT__ instead of 4.
            * gcc.c-torture/compile/pr103813.c: Require size32plus.
            * gcc.c-torture/execute/pr108498-2.c: Same.
            * gcc.c-torture/compile/pr96426.c: Condition on
            __SIZEOF_LONG_LONG__ == __SIZEOF_DOUBLE__.
            * gcc.c-torture/execute/pr103417.c: Require int32plus.
            * gcc.dg/pr104198.c: Same.
            * gcc.dg/pr21137.c: Same.
            * gcc.dg/pr88905.c: Same.
            * gcc.dg/pr90838.c: Same.
            * gcc.dg/pr97317.c: Same.
            * gcc.dg/pr100292.c: Require int32.
            * gcc.dg/pr101008.c: Same.
            * gcc.dg/pr96542.c: Same.
            * gcc.dg/pr96674.c: Same.
            * gcc.dg/pr97750.c: Require ptr_eq_long.

diff --git a/gcc/testsuite/c-c++-common/pr19807-2.c b/gcc/testsuite/c-c++-common/pr19807-2.c
index 529b9c97322..29a370304d3 100644
--- a/gcc/testsuite/c-c++-common/pr19807-2.c
+++ b/gcc/testsuite/c-c++-common/pr19807-2.c
@@ -6,7 +6,7 @@ int i;
 int main()
 {
   int a[4];
-  if ((char*)&a[1] + 4*i + 4 != (char*)&a[i+2])
+  if ((char*)&a[1] + __SIZEOF_INT__*i + __SIZEOF_INT__ != (char*)&a[i+2])
     link_error();
   return 0;
 }
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr103813.c b/gcc/testsuite/gcc.c-torture/compile/pr103813.c
index b3fc066beed..0aa64fb3152 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr103813.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr103813.c
@@ -1,4 +1,5 @@
 /* PR middle-end/103813 */
+/* { dg-require-effective-target size32plus } */

 struct A { char b; char c[0x21000000]; };
 struct A d;
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr96426.c b/gcc/testsuite/gcc.c-torture/compile/pr96426.c
index bd573fe5366..fdb441efc10 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr96426.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr96426.c
@@ -1,5 +1,7 @@
 /* PR middle-end/96426 */

+#if __SIZEOF_LONG_LONG__ == __SIZEOF_DOUBLE__
+
 typedef long long V __attribute__((vector_size(16)));
 typedef double W __attribute__((vector_size(16)));

@@ -8,3 +10,5 @@ foo (V *v)
 {
   __builtin_convertvector (*v, W);
 }
+
+#endif
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr103417.c b/gcc/testsuite/gcc.c-torture/execute/pr103417.c
index 0fef8908036..ea4b99030a5 100644
--- a/gcc/testsuite/gcc.c-torture/execute/pr103417.c
+++ b/gcc/testsuite/gcc.c-torture/execute/pr103417.c
@@ -1,4 +1,5 @@
 /* PR tree-optimization/103417 */
+/* { dg-require-effective-target int32plus } */

 struct { int a : 8; int b : 24; } c = { 0, 1 };

diff --git a/gcc/testsuite/gcc.c-torture/execute/pr108498-2.c b/gcc/testsuite/gcc.c-torture/execute/pr108498-2.c
index ad930488c33..fdd628cbc86 100644
--- a/gcc/testsuite/gcc.c-torture/execute/pr108498-2.c
+++ b/gcc/testsuite/gcc.c-torture/execute/pr108498-2.c
@@ -1,4 +1,5 @@
 /* PR tree-optimization/108498 */
+/* { dg-require-effective-target int32plus } */

 struct U { char c[16]; };
 struct V { char c[16]; };
diff --git a/gcc/testsuite/gcc.dg/pr100292.c b/gcc/testsuite/gcc.dg/pr100292.c
index 675a60c3412..147c9324d81 100644
--- a/gcc/testsuite/gcc.dg/pr100292.c
+++ b/gcc/testsuite/gcc.dg/pr100292.c
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-require-effective-target int32 } */

 typedef unsigned char __attribute__((__vector_size__ (4))) V;

diff --git a/gcc/testsuite/gcc.dg/pr101008.c b/gcc/testsuite/gcc.dg/pr101008.c
index c06208d3425..8229769c6ac 100644
--- a/gcc/testsuite/gcc.dg/pr101008.c
+++ b/gcc/testsuite/gcc.dg/pr101008.c
@@ -1,6 +1,7 @@
 /* PR rtl-optimization/101008 */
 /* { dg-do compile } */
 /* { dg-options "-O2 -g" } */
+/* { dg-require-effective-target int32 } */

 typedef unsigned __attribute__((__vector_size__(32))) U;
 typedef unsigned __attribute__((__vector_size__(16))) V;
diff --git a/gcc/testsuite/gcc.dg/pr104198.c b/gcc/testsuite/gcc.dg/pr104198.c
index bfc7a777184..de86f49c9dc 100644
--- a/gcc/testsuite/gcc.dg/pr104198.c
+++ b/gcc/testsuite/gcc.dg/pr104198.c
@@ -3,6 +3,7 @@

 /* { dg-do run } */
 /* { dg-options "-O2 -std=c99" } */
+/* { dg-require-effective-target int32plus } */

 #include <limits.h>
 #include <assert.h>
diff --git a/gcc/testsuite/gcc.dg/pr21137.c b/gcc/testsuite/gcc.dg/pr21137.c
index 6d73deaee6c..199555a5017 100644
--- a/gcc/testsuite/gcc.dg/pr21137.c
+++ b/gcc/testsuite/gcc.dg/pr21137.c
@@ -1,5 +1,6 @@
 /* { dg-do compile } */
 /* { dg-options "-O2 -fdump-tree-optimized" } */
+/* { dg-require-effective-target int32plus } */

 void foo();

diff --git a/gcc/testsuite/gcc.dg/pr88905.c b/gcc/testsuite/gcc.dg/pr88905.c
index 89792f4abdb..fd2c2647325 100644
--- a/gcc/testsuite/gcc.dg/pr88905.c
+++ b/gcc/testsuite/gcc.dg/pr88905.c
@@ -2,6 +2,7 @@
 /* { dg-do compile } */
 /* { dg-options "-Og -fno-tree-ccp" } */
 /* { dg-additional-options "-mabm" { target { i?86-*-* x86_64-*-* } } } */
+/* { dg-require-effective-target int32plus } */

 int a, b, c;
 extern void baz (int);
diff --git a/gcc/testsuite/gcc.dg/pr90838.c b/gcc/testsuite/gcc.dg/pr90838.c
index 7502b846346..759059683a9 100644
--- a/gcc/testsuite/gcc.dg/pr90838.c
+++ b/gcc/testsuite/gcc.dg/pr90838.c
@@ -3,6 +3,7 @@
/* { dg-additional-options "-mbmi" { target { { i?86-*-* x86_64-*-* } && { ! { ia32 } } } } } */
 /* { dg-additional-options "-march=rv64gc_zbb" { target { rv64 } } } */
 /* { dg-additional-options "-march=rv32gc_zbb" { target { rv32 } } } */
+/* { dg-require-effective-target int32plus } */

 int ctz1 (unsigned x)
 {
diff --git a/gcc/testsuite/gcc.dg/pr96542.c b/gcc/testsuite/gcc.dg/pr96542.c
index 0aad2e9494e..1080be7e753 100644
--- a/gcc/testsuite/gcc.dg/pr96542.c
+++ b/gcc/testsuite/gcc.dg/pr96542.c
@@ -1,6 +1,6 @@
 /* { dg-do compile} */
 /* { dg-options "-O2 -fdump-tree-evrp" } */
-
+/* { dg-require-effective-target int32 } */

 unsigned char
 foo (unsigned int x)
diff --git a/gcc/testsuite/gcc.dg/pr96674.c b/gcc/testsuite/gcc.dg/pr96674.c
index 194ce2e6352..790cd85dcc9 100644
--- a/gcc/testsuite/gcc.dg/pr96674.c
+++ b/gcc/testsuite/gcc.dg/pr96674.c
@@ -1,5 +1,6 @@
 /* { dg-do run } */
 /* { dg-options "-O -fdump-tree-optimized -fwrapv" } */
+/* { dg-require-effective-target int32 } */

 #include <limits.h>
 #include <stdbool.h>
diff --git a/gcc/testsuite/gcc.dg/pr97317.c b/gcc/testsuite/gcc.dg/pr97317.c
index f07327ac9a2..fdc1a62d544 100644
--- a/gcc/testsuite/gcc.dg/pr97317.c
+++ b/gcc/testsuite/gcc.dg/pr97317.c
@@ -1,5 +1,6 @@
 /* { dg-do compile } */
 /* { dg-options "-O2" } */
+/* { dg-require-effective-target int32plus } */

 struct a {
   unsigned c : 17;
diff --git a/gcc/testsuite/gcc.dg/pr97750.c b/gcc/testsuite/gcc.dg/pr97750.c
index 90c3dc26852..ff0d436af20 100644
--- a/gcc/testsuite/gcc.dg/pr97750.c
+++ b/gcc/testsuite/gcc.dg/pr97750.c
@@ -1,6 +1,7 @@
 /* PR tree-optimization/97750 */
 /* { dg-do compile } */
 /* { dg-options "-O2 -Wall -Wextra" } */
+/* { dg-require-effective-target ptr_eq_long } */

 char CopyPlane_src;
 long CopyPlane_copy_pitch;

Reply via email to