summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/torture/pr45967-3.c
blob: 1a23a773b17a163ce65b4b3e0e73e96b5c775dc0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* { dg-do run } */

extern void abort (void);
void
foo (void *p_)
{
  int *p;
  int i;
  for (i = 0; i < sizeof(int *); ++i)
    ((char *)&p)[i] = ((char *)p_)[i];
  *p = 1;
}
int main()
{
  int i = 0;
  int *p = &i;
  foo (&p);
  if (i != 1)
    abort ();
  return 0;
}