Imported Upstream version 4.7.3
[platform/upstream/gcc48.git] / gcc / testsuite / gcc.dg / vect / pr48377.c
1 /* PR tree-optimization/48377 */
2 /* { dg-require-effective-target non_strict_align } */
3
4 typedef unsigned int U __attribute__((__aligned__ (1), __may_alias__));
5
6 __attribute__((noinline, noclone)) unsigned int
7 foo (const char *s, int len)
8 {
9   const U *p = (const U *) s;
10   unsigned int f = len / sizeof (unsigned int), hash = len, i;
11
12   for (i = 0; i < f; ++i)
13     hash += *p++;
14   return hash;
15 }
16
17 char buf[64] __attribute__((aligned (32)));
18
19 int
20 main (void)
21 {
22   return foo (buf + 1, 26) != 26;
23 }
24
25 /* { dg-final { cleanup-tree-dump "vect" } } */