blob: 5b91948661f673d2b9598e11ba60c5c0e4987676 [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 Lattner2e6027c2005-04-09 04:55:14 +00002; RUN: llvm-as < %s | llc -march=x86 -disable-pattern-isel=0 | grep 'fabs$' | wc -l | grep 2
Chris Lattner597f22f2005-04-02 05:35:00 +00003
4declare float %fabsf(float)
5
6float %fabsftest(float %X) {
7 %Y = call float %fabsf(float %X)
8 ret float %Y
9}
10
Chris Lattner2e6027c2005-04-09 04:55:14 +000011double %fabstest2(double %X) {
12 %Y = setge double %X, -0.0
13 %Z = sub double -0.0, %X
14 %Q = select bool %Y, double %X, double %Z
15 ret double %Q
16}
17