libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / no-scevccp-outer-6.c
blob9c1e251f6a79fd34a820d64393696722c508e671
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 #pragma GCC novector
42 for (i=0; i<N; i++)
44 sum = b[i];
45 for (j = 0; j < N; j++){
46 sum += j;
48 if (a[i] != sum)
49 abort();
52 return 0;
55 /* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED." 1 "vect" { xfail { unaligned_stack || { vect_no_align && { ! vect_hw_misalign } } } } } } */
56 /* Exclude widening of i * 4 in the calculation of a[i]. */
57 /* { dg-final { scan-tree-dump-times {vect_recog_widen_mult_pattern: detected: [^\n]* \* ([^4]|4[^;])} 1 "vect" { xfail *-*-* } } } */