gcc/testsuite/gcc.c-torture/execute/20170401-2.c
raw| 1 | void abort (void); |
| 2 | void exit (int); |
| 3 | |
| 4 | void adjust_xy (short *, short *); |
| 5 | |
| 6 | struct adjust_template |
| 7 | { |
| 8 | short kx_x; |
| 9 | short kx_y; |
| 10 | }; |
| 11 | |
| 12 | static struct adjust_template adjust = {1, 1}; |
| 13 | |
| 14 | int |
| 15 | main (void) |
| 16 | { |
| 17 | short x = 1, y = 1; |
| 18 | |
| 19 | adjust_xy (&x, &y); |
| 20 | |
| 21 | if (x != 2) |
| 22 | abort (); |
| 23 | |
| 24 | exit (0); |
| 25 | } |
| 26 | |
| 27 | void |
| 28 | adjust_xy (x, y) |
| 29 | short *x; |
| 30 | short *y; |
| 31 | { |
| 32 | *x = adjust.kx_x * *x + adjust.kx_y * *y; |
| 33 | } |