| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-fdump-tree-crc -O2" } */ |
| 3 |
|
| 4 |
typedef unsigned short ee_u16; |
| 5 |
typedef unsigned char ee_u8; |
| 6 |
|
| 7 |
ee_u16 not_crc(ee_u8 data, ee_u16 crc) { |
| 8 |
ee_u8 i = 0, carry = 0; |
| 9 |
for (i = 0; i < 8; i++) { |
| 10 |
data >>= 1; |
| 11 |
if (data == 1) { |
| 12 |
crc ^= 0x4002; |
| 13 |
carry = 1; |
| 14 |
} else |
| 15 |
carry = 0; |
| 16 |
crc >>= 1; |
| 17 |
if (carry) |
| 18 |
crc |= 0x8000; |
| 19 |
else |
| 20 |
crc &= 0x7fff; |
| 21 |
} |
| 22 |
return crc; |
| 23 |
} |
| 24 |
|
| 25 |
/* { dg-final { scan-tree-dump-times "not_crc function maybe contains CRC calculation" 0 "crc" } } */ |