Merged with mainline at revision 128810.
[official-gcc.git] / gcc / testsuite / gcc.dg / ifelse-2.c
blob0210fcfa4b6c52530e8486cd0984567a1ae6be07
1 /*
2 { dg-do run }
3 { dg-options "-O2" }
4 */
6 extern void abort (void);
8 enum Status
10 P_ON_LOWER = -4,
11 P_ON_UPPER = -2,
12 P_FREE = -1
15 void
16 foo (enum Status *stat, double newUpper, double lower, double max)
18 if (newUpper >= max)
19 *stat = P_FREE;
20 else if (newUpper == lower)
21 *stat = P_ON_LOWER;
24 int
25 main ()
27 enum Status stat = P_ON_UPPER;
29 foo (&stat, 5.0, -10.0, 10.0);
31 if (stat != P_ON_UPPER)
32 abort ();
33 return 0;