summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/torture/pr58554.c
blob: 269171ae941688e7c96ebba5bc2f1843a71e70cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* { dg-do run } */

extern void abort (void);
void __attribute__((noinline,noclone))
clear_board(unsigned char *board, int board_size)
{
  int k;
  for (k = 0; k < 421; k++)
    if (k < board_size )
      board[k] = 3;
}
int main()
{
  unsigned char board[421];
  board[420] = 1;
  clear_board (board, 420);
  if (board[420] != 1)
    abort ();
  return 0;
}