aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/pr42916.c
blob: c2e69e36181193adf593c7ce6225fb7b32fc3ae6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* { dg-do compile } */
/* { dg-options "-O1 -funroll-loops -ftree-vectorize -fcompare-debug" } */
/* { dg-xfail-if "" { powerpc-ibm-aix* } { "*" } { "" } } */

int seed;

static inline int hash(const char *str)
{
  int h = seed++;
  int i = 12;
  while (i--)
    h += (h << 3) ^ *str++;
  return h;
}

void f(const char *str, int *h)
{
  int i = 6;
  while (i--)
    *h++ = hash(str);
}