summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.c-torture/compile/20010518-2.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.c-torture/compile/20010518-2.c')
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20010518-2.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.c-torture/compile/20010518-2.c b/gcc/testsuite/gcc.c-torture/compile/20010518-2.c
new file mode 100644
index 000000000..f35d7c6b9
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20010518-2.c
@@ -0,0 +1,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';
+}