aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr45902.c
blob: 1690b3ab3e5277b8a6af8422fc4749b61193e75b (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
35
36
37
38
39
40
41
42
43
/* { dg-require-effective-target vect_int } */

#include <stdarg.h>
#include <stdlib.h>
#include "tree-vect.h"

#define N 128

short res[N];
short a[N];

int
main1 ()
{
  int i;

  for (i = 0; i < N/4; i+=4)
    {
      res[i] = a[i] >> 8;
      res[i+1] = a[i+1] >> 8;
      res[i+2] = a[i+2] >> 8;
      res[i+3] = a[i+3] >> 8;
    }
}

int
main ()
{
  int i;

  for (i = 0; i < N; i++)
    a[i] = i;

  main1 ();

  for (i = 0; i < N; i++)
    if (res[i] != a[i] >> 8)
      abort ();

  return 0;
}

/* { dg-final { cleanup-tree-dump "vect" } } */