1 /* { dg-do run } */
2 /* { dg-options "-O2 -mavx512f" } */
3 /* { dg-require-effective-target avx512f } */
4 
5 #include "avx512f-check.h"
6 
7 static __m512i
8 __attribute__ ((noinline))
foo(int * v)9 foo (int *v)
10 {
11   return _mm512_set_epi32 (v[15], v[14], v[13], v[12],
12 			   v[11], v[10], v[9], v[8],
13 			   v[7], v[6], v[5], v[4],
14 			   v[3], v[2], v[1], v[0]);
15 }
16 
17 static __m512i
18 __attribute__ ((noinline))
foo_r(int * v)19 foo_r (int *v)
20 {
21   return _mm512_setr_epi32 (v[0], v[1], v[2], v[3],
22 			    v[4], v[5], v[6], v[7],
23 			    v[8], v[9], v[10], v[11],
24 			    v[12], v[13], v[14], v[15]);
25 }
26 
27 static void
avx512f_test(void)28 avx512f_test (void)
29 {
30   int v[16] = { 19832468, 2134, 6576856, 6678,
31 		8723467, 54646, 234566, 12314,
32 		786784, 77575, 645245, 234555,
33 		9487733, 411244, 12344, 86533 };
34   union512i_d res;
35 
36   res.x = foo (v);
37 
38   if (check_union512i_d (res, v))
39     abort ();
40 
41   res.x = _mm512_setzero_si512 ();
42 
43   res.x = foo_r (v);
44 
45   if (check_union512i_d (res, v))
46     abort ();
47 }
48