aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.target/i386/rotate-4a.c
blob: 3da440fb78c8a1d837f287e717bcbfdc2ac9da5d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/* { dg-do run } */
/* { dg-require-effective-target avx } */
/* { dg-options "-O3 -mavx" } */

#include "avx-check.h"

#include "rotate-4.c"

static void
__attribute__((noinline))
avx_test (void)
{
  int i;
  for (i = 0; i < 1024; i++)
    a[i] = i * 1073741789U;
  foo (3);
  for (i = 0; i < 1024; i++)
    {
      unsigned int x = i * 1073741789U;
      if (a[i] != ((x << 3) | (x >> ((-3) & 31))))
	abort ();
    }
  foo (0);
  for (i = 0; i < 1024; i++)
    {
      unsigned int x = i * 1073741789U;
      if (a[i] != ((x << 3) | (x >> ((-3) & 31))))
	abort ();
    }
  foo (29);
  for (i = 0; i < 1024; i++)
    if (a[i] != i * 1073741789U)
      abort ();
}