1/* { dg-do run } */
2/* { dg-options "-O3" } */
3
4typedef unsigned int myint __attribute__((aligned(1)));
5
6typedef struct __attribute__((packed)) S {
7  unsigned a, b, c;
8} SS;
9
10typedef SS __attribute__((aligned(1))) SSS;
11
12
13static unsigned int __attribute__ ((noinline))
14get_a (SSS *p)
15{
16  return p->a;
17};
18
19static int __attribute__ ((noinline, noclone))
20foo (SS *p)
21{
22  int r = (int) get_a(p) + 2;
23  return r;
24}
25
26char buf[512];
27
28static SSS * __attribute__ ((noinline, noclone))
29get_sss (void)
30{
31  return (SSS *)(buf + 1);
32}
33
34
35int
36main(int argc, char *argv[])
37{
38  SSS *p = get_sss();
39  if (foo(p) != 2)
40    __builtin_abort ();
41  return 0;
42}
43