aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/Warray-bounds-8.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.dg/Warray-bounds-8.c')
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Warray-bounds-8.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Warray-bounds-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/Warray-bounds-8.c
new file mode 100644
index 000000000..85839f3f0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Warray-bounds-8.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -Wall" } */
+/* based on PR 43833 */
+
+extern unsigned char data[5];
+
+unsigned char
+foo (char *str)
+{
+ int i, j;
+ unsigned char c = 0;
+
+ for (i = 0; i < 8; i++)
+ {
+ j = i * 5;
+ if ((j % 8) > 3)
+ c |= data[(j / 8) + 1];
+ }
+ return c;
+}