gcc/testsuite/gcc.c-torture/execute/zero-struct-1.c
raw| 1 | struct g{}; |
| 2 | char y[3]; |
| 3 | char *f = &y[0]; |
| 4 | char *ff = &y[0]; |
| 5 | void h(void) |
| 6 | { |
| 7 | struct g t; |
| 8 | *((struct g*)(f++)) = *((struct g*)(ff++)); |
| 9 | *((struct g*)(f++)) = (struct g){}; |
| 10 | t = *((struct g*)(ff++)); |
| 11 | } |
| 12 | |
| 13 | void abort (void); |
| 14 | |
| 15 | int main(void) |
| 16 | { |
| 17 | h(); |
| 18 | if (f != &y[2]) |
| 19 | abort(); |
| 20 | if (ff != &y[2]) |
| 21 | abort(); |
| 22 | return 0; |
| 23 | } |