1 /* Test the self-assignemnt detection plugin. */
2 /* { dg-do compile } */
3 /* { dg-options "-O" } */
15 int x = x; /* { dg-warning "assigned to itself" } */
17 struct Bar b_array[5];
19 b_array[x+g].b_ = b_array[x+g].b_; /* { dg-warning "self-assignment detected" } */
20 g = g; /* { dg-warning "assigned to itself" } */
21 y = y; /* { dg-warning "assigned to itself" } */
22 bar->b_ = bar->b_; /* { dg-warning "assigned to itself" } */