Debian Codegraph @

gcc/testsuite/gcc.dg/torture/crc-crc32-data24.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-fdump-tree-crc-details" } */
3 /* { dg-skip-if "" { *-*-* } { "-O0" "-O1" "-Os" "-flto" } } */
4 /* { dg-require-effective-target int32plus } */
5
6 #include <stdint.h>
7 uint32_t _crc32 (uint32_t data, uint32_t crc) {
8 int i;
9 for (i = 0; i < 24; i++) {
10 if ((crc & 0x80000000) >> 8 ^ (data & 0x800000))
11 crc = (crc << 1) ^ 0x04C11DB7;
12 else
13 crc = (crc << 1);
14 data <<= 1;
15 }
16 return crc;
17 }
18
19 /* { dg-final { scan-tree-dump "_crc32 function maybe contains CRC calculation." "crc" } } */
20 /* { dg-final { scan-tree-dump "Loop iteration number is 23" "crc" } } */
21 /* { dg-final { scan-tree-dump "Bit forward" "crc" } } */