gcc/testsuite/gcc.c-torture/execute/20001024-1.c
raw| 1 | void abort (void); |
| 2 | void exit (int); |
| 3 | |
| 4 | struct a; |
| 5 | |
| 6 | extern int baz (struct a *__restrict x); |
| 7 | |
| 8 | struct a { |
| 9 | long v; |
| 10 | long w; |
| 11 | }; |
| 12 | |
| 13 | struct b { |
| 14 | struct a c; |
| 15 | struct a d; |
| 16 | }; |
| 17 | |
| 18 | int bar (int x, const struct b *__restrict y, struct b *__restrict z) |
| 19 | { |
| 20 | if (y->c.v || y->c.w != 250000 || y->d.v || y->d.w != 250000) |
| 21 | abort(); |
| 22 | } |
| 23 | |
| 24 | void foo(void) |
| 25 | { |
| 26 | struct b x; |
| 27 | x.c.v = 0; |
| 28 | x.c.w = 250000; |
| 29 | x.d = x.c; |
| 30 | bar(0, &x, ((void *)0)); |
| 31 | } |
| 32 | |
| 33 | int main() |
| 34 | { |
| 35 | foo(); |
| 36 | exit(0); |
| 37 | } |