gcc/testsuite/gcc.dg/torture/pr117333.c
raw| 1 | /* { dg-do compile } */ |
| 2 | |
| 3 | struct s |
| 4 | { |
| 5 | unsigned long ul; |
| 6 | int i; |
| 7 | char ac[]; |
| 8 | }; |
| 9 | |
| 10 | const struct s gs = { 3, -4, "abcdef" }; |
| 11 | |
| 12 | void copy_s(struct s*d, const struct s*s) |
| 13 | { |
| 14 | *d = *s; |
| 15 | } |
| 16 | |
| 17 | unsigned test(struct s*ps, _Bool direct) |
| 18 | { |
| 19 | if(direct) |
| 20 | *ps = gs; |
| 21 | else |
| 22 | copy_s(ps, &gs); |
| 23 | return sizeof(*ps); |
| 24 | } |
| 25 | |
| 26 | unsigned size(void) |
| 27 | { |
| 28 | return sizeof(gs); |
| 29 | } |