aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr51590.c
blob: 90075b6e9ee8ae2034dd0b704ac08171cb9ce383 (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
/* PR middle-end/51590 */
/* { dg-do compile } */

struct S { long a, b; };

extern void baz (char *);

static void
bar (struct S *x)
{
  char c[8];
  int i;

  for (i = 0; i < 8; i++)
    c[i] = x->a >> ((7 - i) * 8);

  baz (c);
}

void
foo (const char *x, struct S *y)
{
  struct S d = *y;
  int i;

  for (i = 0; *x; x++)
    i++;

  if (i != 1)
    return;

  bar (&d);
}

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