Debian Codegraph @

gcc/testsuite/gcc.dg/crc-from-fedora-packages-3.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-fdump-tree-crc-details -O2" } */
3 /* { dg-require-effective-target int32plus } */
4
5 #include <stdint.h>
6 //File - as_format
7 uint32_t crc32r(const uint8_t *data, uint32_t size)
8 {
9
10 uint32_t crc = 0xffffffff;
11 for(uint32_t i=0; i != size; i++) {
12 crc = crc ^ data[i];
13 for(int j=0; j<8; j++)
14 if(crc & 1)
15 crc = (crc >> 1) ^ 0xedb88320;
16 else
17 crc = crc >> 1;
18 }
19 return ~crc;
20 }
21
22 /* { dg-final { scan-tree-dump "calculates CRC!" "crc" } } */