libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / pr81633.c
blob2ad144a60444eb82b8e8575efd8fcec94fcd6f01
1 static double identity[4][4] = {{1, 0, 0, 0},
2 {0, 1, 0, 0},
3 {0, 0, 1, 0},
4 {0, 0, 0, 1}};
5 static double expected[4][4] = {{1, 0, 0, 0},
6 {0, 0, 0, 0},
7 {0, 0, 0, 0},
8 {0, 0, 0, 0}};
10 static void __attribute__((noinline,noclone))
11 kernel(double A[4][4])
13 double tmp[4][4];
14 for (int j = 0; j < 4; j++)
15 for (int k = 0; k < 4; k++)
16 tmp[j][k] = identity[j][0] * identity[j][k];
17 for (int j = 0; j < 4; j++ )
18 for (int k = 0; k < 4; k++)
19 A[j][k] = tmp[j][k];
22 int main(void)
24 double A[4][4] = {{0.0}};
25 kernel(A);
26 for ( int i = 0; i < 4; i++ )
27 #pragma GCC novector
28 for ( int j = 0; j < 4; j++ )
29 if (A[i][j] != expected[i][j])
30 __builtin_abort ();
31 return 0;