libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / pr115843.c
blob3dbb6c7927880d98fe8a263deeb006737327d9e3
1 /* { dg-additional-options "-mavx512f --param vect-partial-vector-usage=2" { target avx512f_runtime } } */
3 #include "tree-vect.h"
5 typedef __UINT64_TYPE__ BITBOARD;
6 BITBOARD KingPressureMask1[64], KingSafetyMask1[64];
8 void __attribute__((noinline))
9 foo()
11 for (int i = 0; i < 64; i++)
13 if ((i & 7) == 0)
14 KingPressureMask1[i] = KingSafetyMask1[i + 1];
15 else if ((i & 7) == 7)
16 KingPressureMask1[i] = KingSafetyMask1[i - 1];
17 else
18 KingPressureMask1[i] = KingSafetyMask1[i];
22 BITBOARD verify[64]
23 = {1, 1, 2, 3, 4, 5, 6, 6, 9, 9, 10, 11, 12, 13, 14, 14, 17, 17, 18, 19,
24 20, 21, 22, 22, 25, 25, 26, 27, 28, 29, 30, 30, 33, 33, 34, 35, 36, 37, 38,
25 38, 41, 41, 42, 43, 44, 45, 46, 46, 49, 49, 50, 51, 52, 53, 54, 54, 57, 57,
26 58, 59, 60, 61, 62, 62};
28 int main()
30 check_vect ();
32 #pragma GCC novector
33 for (int i = 0; i < 64; ++i)
34 KingSafetyMask1[i] = i;
35 foo ();
36 #pragma GCC novector
37 for (int i = 0; i < 64; ++i)
38 if (KingPressureMask1[i] != verify[i])
39 __builtin_abort ();
40 return 0;