Debian Codegraph @

gcc/testsuite/gcc.dg/vect/vect-reduc-cond-sub.c

raw
1 /* { dg-require-effective-target vect_int } */
2
3 #include "tree-vect.h"
4
5 int __attribute__((noipa))
6 foo (int n, int* p, int* pi)
7 {
8 int sum = 0;
9 for (int i = 0; i != n; i++)
10 {
11 if (pi[i] > 0)
12 sum -= p[i];
13 }
14 return sum;
15 }
16
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()
23 {
24 check_vect ();
25
26 if (foo (16, p, pi) != 57)
27 abort ();
28 return 0;
29 }