From 484f48f03cf9a382b3bcf4dadac09c4ee59c2ddf Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Thu, 18 Jan 2024 08:51:53 +0100 Subject: testsuite: Fix up scev-16.c test [PR113446] This test FAILs on i686-linux or e.g. sparc*-solaris*, because it uses vect_int effective target outside of */vect/ testsuite. That is wrong, vect_int assumes the extra added flags by vect.exp by default, which aren't added in other testsuites. The following patch fixes that by moving the test into gcc.dg/vect/ and doing small tweaks. 2024-01-18 Jakub Jelinek PR tree-optimization/112774 PR testsuite/113446 * gcc.dg/tree-ssa/scev-16.c: Move test ... * gcc.dg/vect/pr112774.c: ... here. Add PR comment line, use dg-additional-options instead of dg-options and drop -fdump-tree-vect-details. --- gcc/testsuite/gcc.dg/tree-ssa/scev-16.c | 18 ------------------ gcc/testsuite/gcc.dg/vect/pr112774.c | 19 +++++++++++++++++++ 2 files changed, 19 insertions(+), 18 deletions(-) delete mode 100644 gcc/testsuite/gcc.dg/tree-ssa/scev-16.c create mode 100644 gcc/testsuite/gcc.dg/vect/pr112774.c (limited to 'gcc') diff --git a/gcc/testsuite/gcc.dg/tree-ssa/scev-16.c b/gcc/testsuite/gcc.dg/tree-ssa/scev-16.c deleted file mode 100644 index 120f40c..0000000 --- a/gcc/testsuite/gcc.dg/tree-ssa/scev-16.c +++ /dev/null @@ -1,18 +0,0 @@ -/* { dg-do compile } */ -/* { dg-require-effective-target vect_int } */ -/* { dg-options "-O2 -ftree-vectorize -fdump-tree-vect-details" } */ - -int A[1024 * 2]; - -int foo (unsigned offset, unsigned N) -{ - int sum = 0; - - for (unsigned i = 0; i < N; i++) - sum += A[i + offset]; - - return sum; -} - -/* Loop can be vectorized by referring "i + offset" is nonwrapping from array. */ -/* { dg-final { scan-tree-dump "vectorized 1 loops" "vect" { target { ! { avr-*-* msp430-*-* pru-*-* } } } } } */ diff --git a/gcc/testsuite/gcc.dg/vect/pr112774.c b/gcc/testsuite/gcc.dg/vect/pr112774.c new file mode 100644 index 0000000..2ada33b --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/pr112774.c @@ -0,0 +1,19 @@ +/* PR tree-optimization/112774 */ +/* { dg-do compile } */ +/* { dg-require-effective-target vect_int } */ +/* { dg-additional-options "-O2 -ftree-vectorize" } */ + +int A[1024 * 2]; + +int foo (unsigned offset, unsigned N) +{ + int sum = 0; + + for (unsigned i = 0; i < N; i++) + sum += A[i + offset]; + + return sum; +} + +/* Loop can be vectorized by referring "i + offset" is nonwrapping from array. */ +/* { dg-final { scan-tree-dump "vectorized 1 loops" "vect" { target { ! { avr-*-* msp430-*-* pru-*-* } } } } } */ -- cgit v1.1