aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/lto/20120723_1.c
blob: 5c50861b41895b12100760aefeed20090aff5852 (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
/* Make sure that by reference and by value aggregate jump functions do not get
   mixed up.  */

extern void abort (void);

struct S
{
  int i;
  void (*f)(struct S *);
  int j;
};

struct E
{
  struct S *p;
};

extern struct S *gs;
extern int gr;
extern char gc[1024];

static __attribute__ ((noinline, noclone)) struct S *
get_s (void)
{
  return (struct S *) &gc;
}

static void good_target (struct S *s)
{
  gr = 0;
}

extern void bar (struct E e);

void foo (struct E e)
{
  gs->f = good_target;
  bar (e);
}