aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/Warray-bounds-7.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.dg/Warray-bounds-7.c')
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Warray-bounds-7.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Warray-bounds-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/Warray-bounds-7.c
new file mode 100644
index 000000000..fdd95789a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Warray-bounds-7.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -Warray-bounds" } */
+
+char *p;
+
+int main()
+{
+ p = "";
+ if (p[0] == 0
+ || (p[0] == '_' && p[1] == 0)) /* { dg-bogus "array bounds" "" } */
+ return 0;
+ return 1;
+}