2015-12-10 Vladimir Makarov <vmakarov@redhat.com>
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / avx-set-v4di-5.c
blob7bc260c7ba0adef77414eb14fb32855162de9f6e
1 /* { dg-do run } */
2 /* { dg-require-effective-target avx } */
3 /* { dg-options "-O2 -mavx" } */
5 #include "avx-check.h"
7 static __m256i
8 __attribute__((noinline))
9 foo (long long x, int i)
11 switch (i)
13 case 3:
14 return _mm256_set_epi64x (x, 1, 1, 1);
15 case 2:
16 return _mm256_set_epi64x (1, x, 1, 1);
17 case 1:
18 return _mm256_set_epi64x (1, 1, x, 1);
19 case 0:
20 return _mm256_set_epi64x (1, 1, 1, x);
21 default:
22 abort ();
26 static void
27 avx_test (void)
29 long long e = 0xabadbeef01234567LL;
30 long long v[4];
31 union256i_q u;
32 int i, j;
34 for (i = 0; i < ARRAY_SIZE (v); i++)
36 for (j = 0; j < ARRAY_SIZE (v); j++)
37 v[j] = 1;
38 v[i] = e;
39 u.x = foo (e, i);
40 if (check_union256i_q (u, v))
41 abort ();