OSDN Git Service

2004-10-05 Andrew Pinski <pinskia@physics.uc.edu>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.c-torture / compile / 20000329-1.c
1 int giop_tx_big_endian;
2
3 inline
4 void
5 giop_encode_ulong (unsigned long i, char *buf)
6 {
7   if (giop_tx_big_endian)
8     {
9       *(unsigned long *) buf = i;
10     }
11   else
12     {
13       *buf++ = i & 0xff;
14       *buf++ = (i >> 8) & 0xff;
15       *buf++ = (i >> 16) & 0xff;
16       *buf = (i >> 24) & 0xff;
17     }
18 }
19
20
21
22 static
23 double
24 time_giop_encode (unsigned long l)
25 {
26   int c;
27   char buf[4];
28
29   for (c = 0; c < (512 * 1024 * 1024); ++c)
30     {
31       giop_encode_ulong (l, buf);
32     }
33 }
34
35 int
36 main (int ac, char *av[])
37 {
38   giop_tx_big_endian = 1;
39   time_giop_encode (0);
40 }