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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [c-c++-common/] [Wunused-var-4.c] - Blame information for rev 686

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 686 jeremybenn
/* { dg-do compile } */
2
/* { dg-options "-Wunused -W" } */
3
 
4
int
5
f1 (unsigned int x)
6
{
7
  int c = ({ union { unsigned int a; int b; } u; u.a = x; u.b; });
8
  return c;
9
}
10
 
11
void
12
f2 (void)
13
{
14
  struct S { int i; } a;
15
  int b[1];
16
  a.i = 1;
17
  a.i;                          /* { dg-warning "no effect" } */
18
  b[0] = 1;
19
  b[0];                          /* { dg-warning "no effect" } */
20
}
21
 
22
void
23
f3 (void)
24
{
25
  struct S { int i; } a;        /* { dg-warning "set but not used" } */
26
  int b[1];                     /* { dg-warning "set but not used" } */
27
  a.i = 1;
28
  b[0] = 1;
29
}

powered by: WebSVN 2.1.0

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