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

/* This test fails on HC11/HC12 when it is compiled without -mshort because 
   the array is too large (INT_MAX/2 > 64K).  Force to use 16-bit ints
   for it.  */
/* { dg-options "-w -mshort" { target m6811-*-* m6812-*-* } } */

/* Large static storage.  */

#include <limits.h>

static volatile char chars_1[INT_MAX / 2];
static volatile char chars_2[1];

int
foo (void)
{
  chars_1[10] = 'y';
  chars_2[0] = 'x';
}