Debian Codegraph @

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

raw
1 /* { dg-do compile } */
2 /* { dg-options "-fdump-tree-crc-details -O2" } */
3
4 // File - mkiss.i
5 // We don't verify as CRC's value is known.
6 #include <stdint.h>
7 typedef unsigned short int u16;
8
9 u16 crctab[256];
10 void init_crc(void)
11 {
12 short int i, j;
13 u16 accum, data;
14
15 for (i = 0; i < 256; i++) {
16 accum = 0xffff;
17 data = i;
18 for (j = 0; j < 8; ++j) {
19 if ((data^accum) & 0x0001)
20
21
22 accum = (accum >> 1) ^ 0x8408;
23 else
24
25 accum >>= 1;
26 data >>= 1;
27 }
28 crctab[i] = accum;
29 }
30 }
31 /* { dg-final { scan-tree-dump "maybe contains CRC calculation." "crc" } } */