Small ChangeLog tweak.
[official-gcc.git] / gcc / testsuite / gcc.dg / plugin / self-assign-test-1.c
blob28c14dd762a692191de2bd82e1a393668b55dc4d
1 /* Test the self-assignemnt detection plugin. */
2 /* { dg-do compile } */
3 /* { dg-options "-O" } */
5 struct Bar {
6 int b_;
7 int c_;
8 };
10 int g;
12 int main()
14 struct Bar *bar;
15 int x = x; /* { dg-warning "assigned to itself" } */
16 static int y;
17 struct Bar b_array[5];
19 b_array[x+g].b_ = b_array[x+g].b_; /* { dg-warning "self-assignment detected" "" { xfail *-*-* } } */
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" } */