diff options
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.dg/vect/pr60196-1.c')
-rw-r--r-- | gcc-4.9/gcc/testsuite/gcc.dg/vect/pr60196-1.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr60196-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr60196-1.c new file mode 100644 index 000000000..10ed4afeb --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr60196-1.c @@ -0,0 +1,34 @@ +/* PR tree-optimization/63189 */ +/* { dg-additional-options "-fwrapv" } */ +/* { dg-do run } */ + +#include "tree-vect.h" + +__attribute__((noinline, noclone)) static int +bar (const short *a, int len) +{ + int x; + int x1 = 0; + + for (x = 0; x < len; x++) + x1 += x * a[x]; + return x1; +} + +__attribute__((noinline, noclone)) void +foo (void) +{ + short stuff[9] = {1, 1, 1, 1, 1, 1, 1, 1, 1 }; + if (bar (stuff, 9) != 36) + abort (); +} + +int +main () +{ + check_vect (); + foo (); + return 0; +} + +/* { dg-final { cleanup-tree-dump "vect" } } */ |