aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52530.c
blob: f7cdf1a63b3f2bfd784ed53b022dd229147eb09f (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
40
/* { dg-do run } */

extern void abort (void);

#if __SIZEOF_INT__ > 2
struct foo
{
 int *f;
 int i;
};

int baz;
#else
struct foo
{
 long *f;
 long i;
};

long baz;
#endif

void __attribute__ ((noinline))
bar (struct foo x)
{
 *(x.f) = x.i;
}

int
main ()
{
  struct foo x = { &baz, 0xdeadbeef };

  bar (x);

  if (baz != 0xdeadbeef)
    abort ();

  return 0;
}