blob: 9bbd9fdaf0171dd21af91e6dc814bb0af2e8e68e [file] [log] [blame]
Chris Lattner597f22f2005-04-02 05:35:00 +00001; Make sure this testcase codegens to the fabs instruction, not a call to fabsf
Chris Lattnerc22158d2006-05-24 00:49:32 +00002; RUN: llvm-as < %s | llc -march=x86 -mattr=-sse2,-sse3 | grep 'fabs$' | wc -l | grep 1 &&
3; RUN: llvm-as < %s | llc -march=x86 -mattr=-sse2,-sse3 -enable-unsafe-fp-math | grep 'fabs$' | wc -l | grep 2
Chris Lattner597f22f2005-04-02 05:35:00 +00004
5declare float %fabsf(float)
6
7float %fabsftest(float %X) {
8 %Y = call float %fabsf(float %X)
9 ret float %Y
10}
11
Chris Lattner2e6027c2005-04-09 04:55:14 +000012double %fabstest2(double %X) {
13 %Y = setge double %X, -0.0
14 %Z = sub double -0.0, %X
15 %Q = select bool %Y, double %X, double %Z
16 ret double %Q
17}
18