blob: c427869107c1434d2ecad7a4a3128307e5639026 [file] [log] [blame]
Dan Gohmanea25b482010-04-16 15:57:50 +00001; RUN: opt < %s -tailcallelim -S | FileCheck %s
2
Chris Lattner8d9455d2007-09-10 20:58:55 +00003; Don't turn this into an infinite loop, this is probably the implementation
4; of fabs and we expect the codegen to lower fabs.
Dan Gohmanea25b482010-04-16 15:57:50 +00005; CHECK: @fabs(double %f)
6; CHECK: call
7; CHECK: ret
Chris Lattner8d9455d2007-09-10 20:58:55 +00008
9define double @fabs(double %f) {
10entry:
11 %tmp2 = call double @fabs( double %f ) ; <double> [#uses=1]
12 ret double %tmp2
13}
14
Dan Gohmanea25b482010-04-16 15:57:50 +000015; Do turn other calls into infinite loops though.
16
17; CHECK: define double @foo
18; CHECK-NOT: call
19; CHECK: }
20define double @foo(double %f) {
21 %t= call double @foo(double %f)
22 ret double %t
23}
24
25; CHECK: define float @fabsf
26; CHECK-NOT: call
27; CHECK: }
28define float @fabsf(float %f) {
29 %t= call float @fabsf(float 2.0)
30 ret float %t
31}
32
Dan Gohmanea25b482010-04-16 15:57:50 +000033declare x86_fp80 @fabsl(x86_fp80 %f)