gcc/testsuite/gcc.dg/vect/pr114027.c
raw| 1 | #include "tree-vect.h" |
| 2 | |
| 3 | int __attribute__((noipa)) |
| 4 | foo (int *f, int n) |
| 5 | { |
| 6 | int res = 0; |
| 7 | for (int i = 0; i < n; ++i) |
| 8 | { |
| 9 | if (f[2*i]) |
| 10 | res = 2; |
| 11 | if (f[2*i+1]) |
| 12 | res = -2; |
| 13 | } |
| 14 | return res; |
| 15 | } |
| 16 | |
| 17 | int f[] = { 1, 1, 1, 1, 1, 1, 1, 1, |
| 18 | 1, 1, 1, 1, 1, 1, 1, 0 }; |
| 19 | |
| 20 | int |
| 21 | main () |
| 22 | { |
| 23 | if (foo (f, 8) != 2) |
| 24 | __builtin_abort (); |
| 25 | return 0; |
| 26 | } |