Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(22)

Unified Diff: gcc/gcc/testsuite/g++.dg/warn/Warray-bounds.C

Issue 3050029: [gcc] GCC 4.5.0=>4.5.1 (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/nacl-toolchain.git
Patch Set: Created 10 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gcc/gcc/testsuite/g++.dg/tree-ssa/pr33615.C ('k') | gcc/gcc/testsuite/g++.dg/warn/Wconversion2.C » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gcc/gcc/testsuite/g++.dg/warn/Warray-bounds.C
diff --git a/gcc/gcc/testsuite/g++.dg/warn/Warray-bounds.C b/gcc/gcc/testsuite/g++.dg/warn/Warray-bounds.C
index 0385516abd4e215467d9358c8dfce053c0c1fe6e..61c7c5d8e32ea91c4dc97555d53cbbbc31dadf07 100644
--- a/gcc/gcc/testsuite/g++.dg/warn/Warray-bounds.C
+++ b/gcc/gcc/testsuite/g++.dg/warn/Warray-bounds.C
@@ -3,8 +3,9 @@
int a[10];
+extern "C" __SIZE_TYPE__ strlen(const char *s);
+
static inline int n(void) {
- __SIZE_TYPE__ strlen(const char *s);
return strlen("12345");
}
@@ -26,10 +27,10 @@ int* f(void) {
a[ 9] = 0;
a[10] = 0; /* { dg-warning "array subscript" } */
a[11] = 0; /* { dg-warning "array subscript" } */
- a[2 * n() - 11] = 0; /* { dg-warning "array subscript" } */
- a[2 * n() - 10] = 0;
- a[2 * n() - 1] = 0;
- a[2 * n() - 0] = 0; /* { dg-warning "array subscript" } */
+ a[2 * n() - 11] = 1; /* { dg-warning "array subscript" } */
+ a[2 * n() - 10] = 1;
+ a[2 * n() - 1] = 1;
+ a[2 * n() - 0] = 1; /* { dg-warning "array subscript" } */
b[-1] = 0; /* { dg-warning "array subscript" } */
b[ 0] = 0;
@@ -37,10 +38,10 @@ int* f(void) {
b[ 9] = 0;
b[10] = 0; /* { dg-warning "array subscript" } */
b[11] = 0; /* { dg-warning "array subscript" } */
- b[2 * n() - 11] = 0; /* { dg-warning "array subscript" } */
- b[2 * n() - 10] = 0;
- b[2 * n() - 1] = 0;
- b[2 * n() - 0] = 0; /* { dg-warning "array subscript" } */
+ b[2 * n() - 11] = 1; /* { dg-warning "array subscript" } */
+ b[2 * n() - 10] = 1;
+ b[2 * n() - 1] = 1;
+ b[2 * n() - 0] = 1; /* { dg-warning "array subscript" } */
c.c[-1] = 0; /* { dg-warning "array subscript" } */
c.c[ 0] = 0;
@@ -48,10 +49,10 @@ int* f(void) {
c.c[ 9] = 0;
c.c[10] = 0; /* { dg-warning "array subscript" } */
c.c[11] = 0; /* { dg-warning "array subscript" } */
- c.c[2 * n() - 11] = 0; /* { dg-warning "array subscript" } */
- c.c[2 * n() - 10] = 0;
- c.c[2 * n() - 1] = 0;
- c.c[2 * n() - 0] = 0; /* { dg-warning "array subscript" } */
+ c.c[2 * n() - 11] = 1; /* { dg-warning "array subscript" } */
+ c.c[2 * n() - 10] = 1;
+ c.c[2 * n() - 1] = 1;
+ c.c[2 * n() - 0] = 1; /* { dg-warning "array subscript" } */
g(&a[8]);
g(&a[9]);
« no previous file with comments | « gcc/gcc/testsuite/g++.dg/tree-ssa/pr33615.C ('k') | gcc/gcc/testsuite/g++.dg/warn/Wconversion2.C » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698