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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [ifelse-2.c] - Rev 801

Go to most recent revision | 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;
}
 

Go to most recent revision | 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.