diff options
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.dg/Warray-bounds-13.c')
-rw-r--r-- | gcc-4.9/gcc/testsuite/gcc.dg/Warray-bounds-13.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Warray-bounds-13.c b/gcc-4.9/gcc/testsuite/gcc.dg/Warray-bounds-13.c new file mode 100644 index 0000000..7b40a83 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/Warray-bounds-13.c @@ -0,0 +1,18 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -Warray-bounds" } */ + +extern char *bar[17]; + +int foo(int argc, char **argv) +{ + int i; + int n = 0; + + for (i = 0; i < argc; i++) + n++; + + for (i = 0; i < argc; i++) + argv[i] = bar[i + n]; /* { dg-bogus "above array bounds" } */ + + return 0; +} |