Merge from mainline (167278:168000).
[official-gcc/graphite-test-results.git] / gcc / testsuite / gcc.target / ia64 / pr29682.c
blobecca32392d07bed6e9228758b1964e2defa7b88e
1 /* { dg-do compile { target ia64-*-* } } */
2 /* { dg-options "-O3 -msched-control-spec" } */
3 typedef long unsigned int size_t;
4 typedef unsigned char uint8_t;
5 typedef unsigned int uint32_t;
6 typedef uint8_t byte;
7 typedef enum pgpArmor_e
9 PGPARMOR_ERR_CRC_CHECK = -7, PGPARMOR_ERR_BODY_DECODE =
10 -3, PGPARMOR_ERR_UNKNOWN_ARMOR_TYPE = -2, PGPARMOR_ERR_NO_BEGIN_PGP =
11 -1, PGPARMOR_NONE = 0, PGPARMOR_MESSAGE = 1, PGPARMOR_PUBKEY =
12 5, PGPARMOR_PRIVKEY = 6, PGPARMOR_SECKEY = 7
14 pgpArmor;
15 pgpCRC (const byte * octets, size_t len)
17 unsigned int crc = 0xb704ce;
18 int i;
19 while (len--)
21 for (i = 0; i < 8; i++)
23 crc <<= 1;
24 if (crc & 0x1000000)
25 crc ^= 0x1864cfb;
29 pgpReadPkts (const char *fn, const byte ** pkt, size_t * pktlen)
31 const byte *b = ((void *) 0);
32 const char *enc = ((void *) 0);
33 byte *dec;
34 size_t declen;
35 uint32_t crcpkt, crc;
36 int pstate = 0;
37 pgpArmor ec = PGPARMOR_ERR_NO_BEGIN_PGP;
39 switch (pstate)
41 case 0:
42 if (b64decode (enc, (void **) &dec, &declen) != 0)
44 goto exit;
46 crc = pgpCRC (dec, declen);
49 exit:if (ec > PGPARMOR_NONE && pkt)
50 *pkt = b;