blob: fd7585bdb9320697526742c151fddbe75fc92fdc [file] [log] [blame]
Dan Gohmanf17a25c2007-07-18 16:29:46 +00001; Make sure this testcase codegens to the fabs instruction, not a call to fabsf
Dale Johannesen78388382007-09-23 14:58:14 +00002; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=-sse2,-sse3,-sse | \
Dan Gohman8c89a502007-08-15 13:36:28 +00003; RUN: grep fabs\$ | count 1
Dan Gohmanf17a25c2007-07-18 16:29:46 +00004; RUN: llvm-upgrade < %s | llvm-as | \
Dale Johannesen78388382007-09-23 14:58:14 +00005; RUN: llc -march=x86 -mattr=-sse,-sse2,-sse3 -enable-unsafe-fp-math | \
Dan Gohman8c89a502007-08-15 13:36:28 +00006; RUN: grep fabs\$ | count 2
Dan Gohmanf17a25c2007-07-18 16:29:46 +00007
8target endian = little
9target pointersize = 32
10
11declare float %fabsf(float)
12
13float %test1(float %X) {
14 %Y = call float %fabsf(float %X)
15 ret float %Y
16}
17
18double %test2(double %X) {
19 %Y = setge double %X, -0.0
20 %Z = sub double -0.0, %X
21 %Q = select bool %Y, double %X, double %Z
22 ret double %Q
23}
24