| 1 |
/* PR tree-optimization/63189 */ |
| 2 |
/* { dg-additional-options "-fwrapv" } */ |
| 3 |
|
| 4 |
#include "tree-vect.h" |
| 5 |
|
| 6 |
__attribute__((noinline, noclone)) static int |
| 7 |
bar (const short *a, int len) |
| 8 |
{ |
| 9 |
int x; |
| 10 |
int x1 = 0; |
| 11 |
|
| 12 |
for (x = 0; x < len; x++) |
| 13 |
x1 += x * a[x]; |
| 14 |
return x1; |
| 15 |
} |
| 16 |
|
| 17 |
__attribute__((noinline, noclone)) void |
| 18 |
foo (void) |
| 19 |
{ |
| 20 |
short stuff[9] = {1, 1, 1, 1, 1, 1, 1, 1, 1 }; |
| 21 |
if (bar (stuff, 9) != 36) |
| 22 |
abort (); |
| 23 |
} |
| 24 |
|
| 25 |
int |
| 26 |
main () |
| 27 |
{ |
| 28 |
check_vect (); |
| 29 |
foo (); |
| 30 |
return 0; |
| 31 |
} |
| 32 |
|