1 C Test for bug in reg-stack handling conditional moves.
2 C Reported by Tim Prince <tprince@computer.org>
4 C { dg-do run { target { { i[6789]86-*-* x86_64-*-* } && ia32 } } }
5 C { dg-options "-ffast-math -march=pentiumpro" }
7 double precision function foo(x, y)
10 double precision a, b, c, d
31 double precision tolerance
32 parameter (tolerance=1.0D-6)
34 C Each column is a pair of values to feed to foo,
35 C and its expected return value.
36 double precision a(ntests), b(ntests), x(ntests)
37 data a /1, -23, -1, 1, 9, 10, -9/
38 data b /1, -23, 12, -12, 10, 9, -10/
39 data x /0, 0, 1, 1, 0.1, 0.1, 0.1/
42 double precision result
46 result = foo(a(i), b(i))
47 if (abs(result - x(i)) > tolerance) then
48 print *, i, a(i), b(i), x(i), result