gcc/testsuite/gcc.c-torture/execute/pr29156.c
raw| 1 | extern void abort(void); |
| 2 | struct test1 |
| 3 | { |
| 4 | int a; |
| 5 | int b; |
| 6 | }; |
| 7 | struct test2 |
| 8 | { |
| 9 | float d; |
| 10 | struct test1 sub; |
| 11 | }; |
| 12 | |
| 13 | int global; |
| 14 | |
| 15 | int bla(struct test1 *xa, struct test2 *xb) |
| 16 | { |
| 17 | global = 1; |
| 18 | xb->sub.a = 1; |
| 19 | xa->a = 8; |
| 20 | return xb->sub.a; |
| 21 | } |
| 22 | |
| 23 | int main(void) |
| 24 | { |
| 25 | struct test2 pom; |
| 26 | |
| 27 | if (bla (&pom.sub, &pom) != 8) |
| 28 | abort (); |
| 29 | |
| 30 | return 0; |
| 31 | } |
| 32 |