aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58553.c
blob: 542bf3f10187d5841ebc0f6e280457fc236ba8a8 (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
/* { dg-do run } */

#define MAX_LENGTH 96
#define SEQUENCE_LENGTH 31

static struct {
  char buf[MAX_LENGTH + 1];
} u1, u2;

extern void abort (void);

int main ()
{
  int i;
  char c;

  for (i = 0, c = 'A'; i < MAX_LENGTH; i++, c++)
    {
      u1.buf[i] = 'a';
      if (c >= 'A' + SEQUENCE_LENGTH)
	c = 'A';
      u2.buf[i] = c;
    }
  if (u1.buf[MAX_LENGTH] != '\0')
    abort ();

  return 0;
}