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
2008-01-25 Douglas Gregor <doug.gregor@gmail.com>
[official-gcc.git]
/
gcc
/
testsuite
/
gcc.dg
/
20030826-1.c
blob
b344ad2dcbce81c39934cb2da8116c803c96ec7b
1
/* Copyright (C) 2003 Free Software Foundation.
2
3
Check that constant folding of mathematical expressions doesn't
4
break anything.
5
6
Written by Roger Sayle, 24th August 2003. */
7
8
/* { dg-do run } */
9
/* { dg-options "-O2 -ffast-math" } */
10
11
void
abort
(
void
);
12
13
double
foo
(
double
x
)
14
{
15
return
12.0
/(
x
*
3.0
);
16
}
17
18
double
bar
(
double
x
)
19
{
20
return
(
3.0
/
x
)*
4.0
;
21
}
22
23
int
main
()
24
{
25
if
(
foo
(
2.0
) !=
2.0
)
26
abort
();
27
28
if
(
bar
(
2.0
) !=
6.0
)
29
abort
();
30
31
return
0
;
32
}
33