libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-98.c
blob472612745f78f6594bff9894967a4ea98071c867
1 /* { dg-require-effective-target vect_int } */
2 /* { dg-additional-options "-fdump-tree-optimized-details-blocks" } */
4 #include <stdarg.h>
5 #include "tree-vect.h"
7 #define M 8
8 #define N 4
9 #define DOT4( a, b ) ( a[0]*b[0] + a[1]*b[1] + a[2]*b[2] + a[3]*b[3] )
11 __attribute__ ((noinline))
12 int main1 (int ia[][N])
14 int i, j;
15 int ib[N] = {0,3,6,9};
16 int ic[M][M];
18 for (i = 0; i < M; i++)
20 ic[0][i] = DOT4 (ia[i], ib);
23 /* check results: */
24 #pragma GCC novector
25 for (i = 0; i < M; i++)
27 if (ic[0][i] != DOT4 (ia[i], ib))
28 abort();
31 return 0;
34 int main (void)
36 int ia[M][N] = {{1,2,3,4},{2,3,5,7},{2,4,6,8},{22,43,55,77},
37 {13,17,19,23},{29,31,37,41},{3,7,2,1},{4,9,8,3}};
39 check_vect ();
41 return main1 (ia);
44 /* Needs interleaving support. */
45 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided4 } } } */
46 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" { xfail vect_strided4 } } } */
47 /* { dg-final { scan-tree-dump-not "Invalid sum" "optimized" } } */