summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.c-torture/compile/20000329-1.c
blob: 547bf96f95528a22db917f2f70a881fed54c45f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
int giop_tx_big_endian;

inline
void
giop_encode_ulong (unsigned long i, char *buf)
{
  if (giop_tx_big_endian)
    {
      *(unsigned long *) buf = i;
    }
  else
    {
      *buf++ = i & 0xff;
      *buf++ = (i >> 8) & 0xff;
      *buf++ = (i >> 16) & 0xff;
      *buf = (i >> 24) & 0xff;
    }
}



static
double
time_giop_encode (unsigned long l)
{
  int c;
  char buf[4];

  for (c = 0; c < (512 * 1024 * 1024); ++c)
    {
      giop_encode_ulong (l, buf);
    }
}

int
main (int ac, char *av[])
{
  giop_tx_big_endian = 1;
  time_giop_encode (0);
}