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