aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/torture/20090618-1.c
blob: 8b601d62c79d2ccbf815077405e5b5bb43b494b8 (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
/* { dg-do run } */
/* { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */

extern void abort (void);

struct X { int *p; int *q; };

int foo(void)
{
  int i = 0, j = 1;
  struct X x, y;
  int **p;
  y.p = &i;
  x.q = &j;
  p = __builtin_mempcpy (&x, &y, sizeof (int *));
  return **p;
}

int main()
{
  if (foo() != 1)
    abort ();
  return 0;
}