OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [plugin/] [self-assign-test-1.c] - Blame information for rev 689

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 689 jeremybenn
/* Test the self-assignemnt detection plugin.  */
2
/* { dg-do compile } */
3
/* { dg-options "-O" } */
4
 
5
struct Bar {
6
  int b_;
7
  int c_;
8
};
9
 
10
int g;
11
 
12
int main()
13
{
14
  struct Bar *bar;
15
  int x = x; /* { dg-warning "assigned to itself" } */
16
  static int y;
17
  struct Bar b_array[5];
18
 
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" } */
23
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.