gcc/testsuite/gcc.c-torture/execute/950322-1.c
raw| 1 | /* { dg-additional-options "-fpermissive" } */ |
| 2 | |
| 3 | f (unsigned char *a) |
| 4 | { |
| 5 | int i, j; |
| 6 | int x, y; |
| 7 | |
| 8 | j = a[1]; |
| 9 | i = a[0] - j; |
| 10 | if (i < 0) |
| 11 | { |
| 12 | x = 1; |
| 13 | y = -i; |
| 14 | } |
| 15 | else |
| 16 | { |
| 17 | x = 0; |
| 18 | y = i; |
| 19 | } |
| 20 | return x + y; |
| 21 | } |
| 22 | |
| 23 | |
| 24 | main () |
| 25 | { |
| 26 | unsigned char a[2]; |
| 27 | a[0] = 8; |
| 28 | a[1] = 9; |
| 29 | if (f (a) != 2) |
| 30 | abort (); |
| 31 | exit (0); |
| 32 | } |