URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Subversion Repositories openrisc_me
[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [ifelse-2.c] - Rev 328
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