1 /* Duff's device is legal C; test to make sure the compiler
2 doesn't complain about it.
4 Jason Thorpe <thorpej@wasabisystems.com>
5 Derived from the BSD Telnet Kerberos 4 checksum routine.
9 /* { dg-options "-O2" } */
11 extern void abort (void);
12 extern void exit (int);
14 #if __INT_MAX__ >= 2147483647
15 /* At least 32-bit integers. */
22 cksum (const unsigned char *src
, unsigned long size
)
31 ck
^= (type32
)*src
++ << 24;
34 ck
^= (type32
)*src
++ << 16;
37 ck
^= (type32
)*src
++ << 8;
48 const char testpat
[] = "The quick brown fox jumped over the lazy dog.";
55 ck
= cksum ((const unsigned char *) testpat
, sizeof (testpat
));