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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [ifelse-2.c] - Rev 826

Compare with Previous | Blame | View Log

/*
{ dg-do run }
{ dg-options "-O2" }
*/
 
extern void abort (void);
 
enum Status
{
  P_ON_LOWER = -4,
  P_ON_UPPER = -2,
  P_FREE = -1
};
 
void
foo (enum Status *stat, double newUpper, double lower, double max)
{
  if (newUpper >= max)
    *stat = P_FREE;
  else if (newUpper == lower)
    *stat = P_ON_LOWER;
}
 
int
main ()
{
  enum Status stat = P_ON_UPPER;
 
  foo (&stat, 5.0, -10.0, 10.0);
 
  if (stat != P_ON_UPPER)
    abort ();
  return 0;
}
 

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.