testsuite: Revert to the original version of pr100056.c
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-reduc-cond-sub.c
blob0213a0ab4fdeb23edaaaeb1be0e0e61db2cdc4f6
1 /* { dg-require-effective-target vect_int } */
3 #include "tree-vect.h"
5 int __attribute__((noipa))
6 foo (int n, int* p, int* pi)
8 int sum = 0;
9 for (int i = 0; i != n; i++)
11 if (pi[i] > 0)
12 sum -= p[i];
14 return sum;
17 int p[16] __attribute__((aligned(__BIGGEST_ALIGNMENT__)))
18 = { 7, 3, 1, 4, 9, 10, 14, 7, -10, -55, 20, 9, 1, 2, 0, -17 };
19 int pi[16] __attribute__((aligned(__BIGGEST_ALIGNMENT__)))
20 = { 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1 };
21 int
22 main()
24 check_vect ();
26 if (foo (16, p, pi) != 57)
27 abort ();
28 return 0;