Fix ICE in substring-handling building 502.gcc_r (PR 87562)
[official-gcc.git] / gcc / testsuite / gcc.dg / plugin / self-assign-test-2.c
blob2ede371a69aa885a68208868c7102ec07a3f7fc2
1 /* Test the self-assignemnt detection plugin with the 'disable' argument. */
2 /* { dg-do compile } */
3 /* { dg-options "-O -fplugin-arg-selfassign-disable" } */
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-bogus "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-bogus "self-assignment detected" } */
20 g = g; /* { dg-bogus "assigned to itself" } */
21 y = y; /* { dg-bogus "assigned to itself" } */
22 bar->b_ = bar->b_; /* { dg-bogus "assigned to itself" } */