gcc/testsuite/gcc.dg/cpp/if-shift.c
raw| 1 | /* Copyright (C) 2000 Free Software Foundation, Inc. */ |
| 2 | |
| 3 | /* { dg-do preprocess } */ |
| 4 | |
| 5 | /* Test shift operators. */ |
| 6 | |
| 7 | #if 1 << 4 != 16 |
| 8 | #error /* { dg-bogus "error" "<< +ve shift" } */ |
| 9 | #endif |
| 10 | |
| 11 | #if 19 >> 2 != 4 |
| 12 | #error /* { dg-bogus "error" ">> +ve shift" } */ |
| 13 | #endif |
| 14 | |
| 15 | #if 17 << -2 != 17 >> 2 |
| 16 | #error /* { dg-bogus "error" "<< -ve shift" } */ |
| 17 | #endif |
| 18 | |
| 19 | #if 25 >> -2 != 25 << 2 |
| 20 | #error /* { dg-bogus "error" ">> -ve shift" } */ |
| 21 | #endif |
| 22 |