| 1 |
#include "analyzer-decls.h" |
| 2 |
|
| 3 |
struct coord |
| 4 |
{ |
| 5 |
int x; |
| 6 |
int y; |
| 7 |
}; |
| 8 |
|
| 9 |
void test_1 (void) |
| 10 |
{ |
| 11 |
struct coord arr[16]; |
| 12 |
|
| 13 |
arr[2].y = 4; |
| 14 |
arr[3].x = 5; |
| 15 |
arr[3].y = 6; |
| 16 |
arr[4].x = 7; |
| 17 |
arr[6].y = 8; |
| 18 |
arr[8].x = 9; |
| 19 |
|
| 20 |
arr[7] = arr[3]; |
| 21 |
|
| 22 |
__analyzer_eval (arr[7].x == 5); /* { dg-warning "TRUE" } */ |
| 23 |
__analyzer_eval (arr[7].y == 6); /* { dg-warning "TRUE" } */ |
| 24 |
|
| 25 |
/* Make sure we don't touch the neighbors. */ |
| 26 |
__analyzer_eval (arr[6].y == 8); /* { dg-warning "TRUE" } */ |
| 27 |
__analyzer_eval (arr[8].x == 9); /* { dg-warning "TRUE" } */ |
| 28 |
} |