2018-01-16 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / no-scevccp-outer-6.c
blobd4d84220d8dd90fd120a02b220610b8f5eae9801
1 /* { dg-require-effective-target vect_int } */
3 #include <stdarg.h>
4 #include "tree-vect.h"
6 #define N 40
8 __attribute__ ((noinline)) int
9 foo (int * __restrict__ b, int k){
10 int i,j;
11 int sum,x;
12 int a[N];
14 for (i = 0; i < N; i++) {
15 sum = b[i];
16 for (j = 0; j < N; j++) {
17 sum += j;
19 a[i] = sum;
22 return a[k];
25 int main (void)
27 int i,j;
28 int sum;
29 int b[N];
30 int a[N];
32 check_vect ();
34 for (i=0; i<N; i++)
35 b[i] = i + 2;
37 for (i=0; i<N; i++)
38 a[i] = foo (b,i);
40 /* check results: */
41 for (i=0; i<N; i++)
43 sum = b[i];
44 for (j = 0; j < N; j++){
45 sum += j;
47 if (a[i] != sum)
48 abort();
51 return 0;
54 /* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED." 1 "vect" { xfail { unaligned_stack || { vect_no_align && { ! vect_hw_misalign } } } } } } */
55 /* { dg-final { scan-tree-dump-times "vect_recog_widen_mult_pattern: detected" 1 "vect" { xfail *-*-* } } } */