Debian Codegraph @

gcc/testsuite/gcc.dg/crc-not-crc-13.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-fdump-tree-crc -O2" } */
3
4 #include <stdint.h>
5
6 uint8_t not_crc(uint8_t crc, uint8_t data) {
7 uint8_t i;
8 crc = crc ^ data;
9 for (i = 0; i < 8; i++) {
10 if (crc & 0x01)
11 crc = (crc >> 1) ^ 0x8C;
12 else
13 crc >>= 1;
14 if (i > 1)
15 crc = 8;
16 }
17 return crc;
18 }
19
20 /* { dg-final { scan-tree-dump-times "calculates CRC!" 0 "crc" } } */