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 __attribute__((noinline,noclone)) 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; }