aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr63379.c
blob: f6e8fc6a4ce9cd76d5f99a02e3355da7d9638d7f (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
/* PR tree-optimization/63379  */
/* { dg-do run } */

#include "tree-vect.h"

extern void abort (void);

typedef struct {
    int x;
    int y;
} Point;

Point pt_array[25];

void __attribute__((noinline,noclone))
generate_array(void)
{
  unsigned int i;
  for (i = 0; i<25; i++)
    {
      pt_array[i].x = i;
      pt_array[i].y = 1000+i;
    }
}

int main()
{
  check_vect ();
  generate_array ();
  Point min_pt = pt_array[0];
  Point *ptr, *ptr_end;
  for (ptr = pt_array+1, ptr_end = pt_array+25; ptr != ptr_end; ++ptr)
    {
      min_pt.x = (min_pt.x < ptr->x) ? min_pt.x : ptr->x;
      min_pt.y = (min_pt.y < ptr->y) ? min_pt.y : ptr->y;
    }

  if (min_pt.x != 0 || min_pt.y != 1000)
    abort ();
  return 0;
}

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