From: Richard Biener Date: Thu, 22 Jun 2017 08:14:21 +0000 (+0000) Subject: pr65947-14.c: New testcase. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=85d5b033ae83c37ae0b4dbd4210d463dcacc4842;p=gcc.git pr65947-14.c: New testcase. 2017-06-22 Richard Biener * gcc.dg/vect/pr65947-14.c: New testcase. From-SVN: r249500 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index fa14c61eed5..907e1769106 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2017-06-22 Richard Biener + + * gcc.dg/vect/pr65947-14.c: New testcase. + 2017-06-21 Michael Meissner PR target/80510 diff --git a/gcc/testsuite/gcc.dg/vect/pr65947-14.c b/gcc/testsuite/gcc.dg/vect/pr65947-14.c new file mode 100644 index 00000000000..2b15707fa23 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/pr65947-14.c @@ -0,0 +1,44 @@ +/* { dg-require-effective-target vect_condition } */ + +#include "tree-vect.h" + +extern void abort (void) __attribute__ ((noreturn)); + +#define N 27 + +/* Condition reduction with matches only in even lanes at runtime. */ + +int +condition_reduction (int *a, int min_v) +{ + int last = N + 96; + + for (int i = 0; i < N; i++) + if (a[i] > min_v) + last = i; + + return last; +} + +int +main (void) +{ + int a[N] = { + 47, 12, 13, 14, 15, 16, 17, 18, 19, 20, + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, + 21, 22, 23, 24, 25, 26, 27 + }; + + check_vect (); + + int ret = condition_reduction (a, 46); + + /* loop should have found a value of 0, not default N + 96. */ + if (ret != 0) + abort (); + + return 0; +} + +/* { dg-final { scan-tree-dump-times "LOOP VECTORIZED" 2 "vect" { xfail { ! vect_max_reduc } } } */ +/* { dg-final { scan-tree-dump-times "condition expression based on integer induction." 4 "vect" } } */