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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [Wunused-value-1.c] - Blame information for rev 801

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 689 jeremybenn
/* Test -Wunused-value.  Bug 23113.  */
2
/* Origin: Joseph Myers <joseph@codesourcery.com> */
3
/* { dg-do compile } */
4
/* { dg-options "-Wunused-value" } */
5
 
6
int f (void);
7
void g (void);
8
int *p;
9
 
10
void
11
h (void)
12
{
13
  1 + f (); /* { dg-warning "value computed is not used" } */
14
  f () + f (); /* { dg-warning "value computed is not used" } */
15
  f () + f (), f (); /* { dg-warning "value computed is not used" } */
16
  (char) f (); /* { dg-warning "value computed is not used" } */
17
  g ();
18
  f ();
19
  (void) f ();
20
  *p++; /* { dg-warning "value computed is not used" } */
21
  ++*p;
22
  (*p ? f() : 0);
23
  ({ f(); });
24
  /* Statement expressions may be used in macro expansions which like
25
     functions return values which may or may not be of use, so don't
26
     warn for them but do warn inside them.  */
27
  ({ f() + 1; });
28
  ({ f(); 0; });
29
  ({ f() + 1; 0; }); /* { dg-warning "value computed is not used" } */
30
  1 + ({ f(); }); /* { dg-warning "value computed is not used" } */
31
}

powered by: WebSVN 2.1.0

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