aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorTamar Christina <tamar.christina@arm.com>2024-01-12 15:27:45 +0000
committerTamar Christina <tamar.christina@arm.com>2024-01-12 15:32:19 +0000
commitd14ef0987de2f6f2dac64f4f0f068b929078a01d (patch)
tree6513756e0e9cb95f95a00d4fccbbf64f43881932 /gcc
parenta8dbae45926db1ebc94c0cc32647c3a45ca62eef (diff)
downloadgcc-d14ef0987de2f6f2dac64f4f0f068b929078a01d.zip
gcc-d14ef0987de2f6f2dac64f4f0f068b929078a01d.tar.gz
gcc-d14ef0987de2f6f2dac64f4f0f068b929078a01d.tar.bz2
testsuite: Make bitint early vect test more accurate
This changes the tests I committed for PR113287 to also run on targets that don't support bitint. gcc/ChangeLog: PR tree-optimization/113287 * doc/sourcebuild.texi (check_effective_target_bitint65535): New. gcc/testsuite/ChangeLog: PR tree-optimization/113287 * gcc.dg/vect/vect-early-break_100-pr113287.c: Support non-bitint. * gcc.dg/vect/vect-early-break_99-pr113287.c: Likewise. * lib/target-supports.exp (bitint, bitint128, bitint575, bitint65535): Document them.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/doc/sourcebuild.texi12
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-early-break_100-pr113287.c25
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-early-break_99-pr113287.c9
-rw-r--r--gcc/testsuite/lib/target-supports.exp9
4 files changed, 43 insertions, 12 deletions
diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi
index 2a96927..8082100 100644
--- a/gcc/doc/sourcebuild.texi
+++ b/gcc/doc/sourcebuild.texi
@@ -2877,6 +2877,18 @@ Target supports Graphite optimizations.
@item fixed_point
Target supports fixed-point extension to C.
+@item bitint
+Target supports _BitInt(N).
+
+@item bitint128
+Target supports _BitInt(128).
+
+@item bitint575
+Target supports _BitInt(575).
+
+@item bitint65535
+Target supports _BitInt(65535).
+
@item fopenacc
Target supports OpenACC via @option{-fopenacc}.
diff --git a/gcc/testsuite/gcc.dg/vect/vect-early-break_100-pr113287.c b/gcc/testsuite/gcc.dg/vect/vect-early-break_100-pr113287.c
index f908e5b..aa10062 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-early-break_100-pr113287.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-early-break_100-pr113287.c
@@ -1,28 +1,31 @@
/* { dg-add-options vect_early_break } */
/* { dg-require-effective-target vect_early_break } */
-/* { dg-require-effective-target vect_int } */
-/* { dg-require-effective-target bitint } */
+/* { dg-require-effective-target vect_long_long } */
+
+/* { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" } } */
+
+#include "tree-vect.h"
__attribute__((noipa)) void
-bar (unsigned long *p)
+bar (unsigned long long *p)
{
- __builtin_memset (p, 0, 142 * sizeof (unsigned long));
- p[17] = 0x50000000000UL;
+ __builtin_memset (p, 0, 142 * sizeof (unsigned long long));
+ p[17] = 0x50000000000ULL;
}
__attribute__((noipa)) int
foo (void)
{
- unsigned long r[142];
+ unsigned long long r[142];
bar (r);
- unsigned long v = ((long) r[0] >> 31);
+ unsigned long long v = ((long) r[0] >> 31);
if (v + 1 > 1)
return 1;
- for (unsigned long i = 1; i <= 140; ++i)
+ for (unsigned long long i = 1; i <= 140; ++i)
if (r[i] != v)
return 1;
- unsigned long w = r[141];
- if ((unsigned long) (((long) (w << 60)) >> 60) != v)
+ unsigned long long w = r[141];
+ if ((unsigned long long) (((long) (w << 60)) >> 60) != v)
return 1;
return 0;
}
@@ -30,6 +33,8 @@ foo (void)
int
main ()
{
+ check_vect ();
+
if (foo () != 1)
__builtin_abort ();
}
diff --git a/gcc/testsuite/gcc.dg/vect/vect-early-break_99-pr113287.c b/gcc/testsuite/gcc.dg/vect/vect-early-break_99-pr113287.c
index b92a8a2..e616218 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-early-break_99-pr113287.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-early-break_99-pr113287.c
@@ -1,7 +1,10 @@
/* { dg-add-options vect_early_break } */
/* { dg-require-effective-target vect_early_break } */
-/* { dg-require-effective-target vect_int } */
-/* { dg-require-effective-target bitint } */
+/* { dg-require-effective-target bitint65535 } */
+
+/* { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" } } */
+
+#include "tree-vect.h"
_BitInt(998) b;
char c;
@@ -24,6 +27,8 @@ foo(char y, _BitInt(9020) a, char *r)
int
main(void)
{
+ check_vect ();
+
char x;
foo(5, 5, &x);
if (x != 1)
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 43aa24a..81ae92a 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -3858,6 +3858,15 @@ proc check_effective_target_bitint575 { } {
} "-std=c23"]
}
+# Return 1 if the target supports _BitInt(65535), 0 otherwise.
+
+proc check_effective_target_bitint65535 { } {
+ return [check_no_compiler_messages bitint65535 object {
+ _BitInt (2) a = 1wb;
+ unsigned _BitInt (65535) b = 0uwb;
+ } "-std=c23"]
+}
+
# Return 1 if the target supports compiling decimal floating point,
# 0 otherwise.