repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Merged with mainline at revision 128810.
[official-gcc.git]
/
gcc
/
testsuite
/
gcc.dg
/
ifelse-2.c
blob
0210fcfa4b6c52530e8486cd0984567a1ae6be07
1
/*
2
{ dg-do run }
3
{ dg-options "-O2" }
4
*/
5
6
extern
void
abort
(
void
);
7
8
enum
Status
9
{
10
P_ON_LOWER
= -
4
,
11
P_ON_UPPER
= -
2
,
12
P_FREE
= -
1
13
};
14
15
void
16
foo
(
enum
Status
*
stat
,
double
newUpper
,
double
lower
,
double
max
)
17
{
18
if
(
newUpper
>=
max
)
19
*
stat
=
P_FREE
;
20
else if
(
newUpper
==
lower
)
21
*
stat
=
P_ON_LOWER
;
22
}
23
24
int
25
main
()
26
{
27
enum
Status stat
=
P_ON_UPPER
;
28
29
foo
(&
stat
,
5.0
, -
10.0
,
10.0
);
30
31
if
(
stat
!=
P_ON_UPPER
)
32
abort
();
33
return
0
;
34
}