diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/Warray-bounds-7.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/Warray-bounds-7.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/Warray-bounds-7.c b/gcc/testsuite/gcc.dg/Warray-bounds-7.c new file mode 100644 index 000000000..fdd95789a --- /dev/null +++ b/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; +} |