summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/i386/20000614-2.c
blob: 5b0490707c2de2c97475d4664bc08999ffacd5d1 (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
/* { dg-do run } */
/* { dg-options "-O2" } */

extern void abort (void);
extern void exit (int);

char buf[8];

void bar(char *p)
{
}

int main()
{
  union {
    unsigned int val;
    unsigned char p[4];
  } serial;

  int i;
  serial.val = 0;
  bar(buf);
  for(i = 0; i < 8; i += 4)
    {
      serial.p [0] += buf [i + 0];
      serial.p [1] += buf [i + 1];
      serial.p [2] += buf [i + 2];
      serial.p [3] += buf [i + 3];
    }
  if (serial.val)
    abort();
  exit(0);
}