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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [gcc.dg/] [Wenum-compare-1.c] - Rev 338

Compare with Previous | Blame | View Log

/* { dg-do compile } */
/* { dg-options "-Wenum-compare" } */
enum E1 { A, B, C };
enum E2 { D, E, F };
extern void f2 ();
void
f1 ()
{
  int a = A;
  int d = D;
  enum E1 e1 = A;
  enum E2 e2 = D;
  if (A > D)	/* { dg-warning "comparison between .enum E1. and .enum E2." } */
    f2 ();
  if (e1 > e2)  /* { dg-warning "comparison between .enum E1. and .enum E2." } */
    f2 ();
  if (e1 > e2 + 1)
    f2 ();
  if (A > 0)
    f2 ();
  if (e1 > 0)
    f2 ();
  if (A + D > 0)
    f2 ();
  if (e1 > 0)
    f2 ();
  if (A + D > 0)
    f2 ();
  if ((int) A > D)
    f2 ();
  if ((int) e1 > e2)
    f2 ();
}
 

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

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