gcc/testsuite/gcc.c-torture/compile/subcc.c
raw| 1 | /* { dg-additional-options "-std=gnu89" } */ |
| 2 | |
| 3 | int foo (a, c) |
| 4 | { |
| 5 | int b; |
| 6 | |
| 7 | if (a + c >= 0) /* b < 0 ==== a < 10? */ |
| 8 | return a | 0x80000000; |
| 9 | return 0; |
| 10 | } |
| 11 | |
| 12 | void bar (a) |
| 13 | int a; |
| 14 | { |
| 15 | if (foo (a, 10) & 0x80000000) |
| 16 | printf ("y"); |
| 17 | else |
| 18 | printf ("n"); |
| 19 | } |
| 20 | |
| 21 | int main () |
| 22 | { |
| 23 | bar (0); |
| 24 | bar (1); |
| 25 | bar (-1); |
| 26 | bar (10); |
| 27 | bar (-10); |
| 28 | bar (11); |
| 29 | bar (-11); |
| 30 | bar (0x7fffffff); |
| 31 | bar (-0x7fffffff); |
| 32 | |
| 33 | puts (""); |
| 34 | return 0; |
| 35 | } |