]>
Commit | Line | Data |
---|---|---|
f8269ad4 RB |
1 | /* { dg-do compile } */ |
2 | /* { dg-options "-O2 -Warray-bounds" } */ | |
3 | ||
4 | int a[10]; | |
5 | int *foo1 (int i) | |
6 | { | |
7 | return &a[10]; /* { dg-bogus "above array bounds" } */ | |
8 | } | |
9 | int *foo2 (int i) | |
10 | { | |
11 | return &a[11]; /* { dg-warning "above array bounds" } */ | |
12 | } | |
13 | int foo3 (int i) | |
14 | { | |
15 | return a[9]; /* { dg-bogus "above array bounds" } */ | |
16 | } | |
17 | int foo4 (int i) | |
18 | { | |
19 | return a[10]; /* { dg-warning "above array bounds" } */ | |
20 | } |