1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-31 16:02:52 +01:00
llvm-mirror/test/Transforms/IndVarSimplify/floating-point-iv.ll
Stephen Lin cf082ae903 Update Transforms tests to use CHECK-LABEL for easier debugging. No functionality change.
This update was done with the following bash script:

  find test/Transforms -name "*.ll" | \
  while read NAME; do
    echo "$NAME"
    if ! grep -q "^; *RUN: *llc" $NAME; then
      TEMP=`mktemp -t temp`
      cp $NAME $TEMP
      sed -n "s/^define [^@]*@\([A-Za-z0-9_]*\)(.*$/\1/p" < $NAME | \
      while read FUNC; do
        sed -i '' "s/;\(.*\)\([A-Za-z0-9_]*\):\( *\)@$FUNC\([( ]*\)\$/;\1\2-LABEL:\3@$FUNC(/g" $TEMP
      done
      mv $TEMP $NAME
    fi
  done

llvm-svn: 186268
2013-07-14 01:42:54 +00:00

93 lines
2.4 KiB
LLVM

; RUN: opt < %s -indvars -S | FileCheck %s
define void @test1() nounwind {
entry:
br label %bb
bb: ; preds = %bb, %entry
%x.0.reg2mem.0 = phi double [ 0.000000e+00, %entry ], [ %1, %bb ] ; <double> [#uses=2]
%0 = tail call i32 @foo(double %x.0.reg2mem.0) nounwind ; <i32> [#uses=0]
%1 = fadd double %x.0.reg2mem.0, 1.000000e+00 ; <double> [#uses=2]
%2 = fcmp olt double %1, 1.000000e+04 ; <i1> [#uses=1]
br i1 %2, label %bb, label %return
return: ; preds = %bb
ret void
; CHECK-LABEL: @test1(
; CHECK: icmp
}
declare i32 @foo(double)
define void @test2() nounwind {
entry:
br label %bb
bb: ; preds = %bb, %entry
%x.0.reg2mem.0 = phi double [ -10.000000e+00, %entry ], [ %1, %bb ] ; <double> [#uses=2]
%0 = tail call i32 @foo(double %x.0.reg2mem.0) nounwind ; <i32> [#uses=0]
%1 = fadd double %x.0.reg2mem.0, 2.000000e+00 ; <double> [#uses=2]
%2 = fcmp olt double %1, -1.000000e+00 ; <i1> [#uses=1]
br i1 %2, label %bb, label %return
return: ; preds = %bb
ret void
; CHECK-LABEL: @test2(
; CHECK: icmp
}
define void @test3() nounwind {
entry:
br label %bb
bb: ; preds = %bb, %entry
%x.0.reg2mem.0 = phi double [ 0.000000e+00, %entry ], [ %1, %bb ]
%0 = tail call i32 @foo(double %x.0.reg2mem.0) nounwind
%1 = fadd double %x.0.reg2mem.0, 1.000000e+00
%2 = fcmp olt double %1, -1.000000e+00
br i1 %2, label %bb, label %return
return:
ret void
; CHECK-LABEL: @test3(
; CHECK: fcmp
}
define void @test4() nounwind {
entry:
br label %bb
bb: ; preds = %bb, %entry
%x.0.reg2mem.0 = phi double [ 40.000000e+00, %entry ], [ %1, %bb ] ; <double> [#uses=2]
%0 = tail call i32 @foo(double %x.0.reg2mem.0) nounwind ; <i32> [#uses=0]
%1 = fadd double %x.0.reg2mem.0, -1.000000e+00 ; <double> [#uses=2]
%2 = fcmp olt double %1, 1.000000e+00 ; <i1> [#uses=1]
br i1 %2, label %bb, label %return
return:
ret void
; CHECK-LABEL: @test4(
; CHECK-NOT: cmp
; CHECK: br i1 false
}
; PR6761
define void @test5() nounwind {
; <label>:0
br label %1
; <label>:1 ; preds = %1, %0
%2 = phi double [ 9.000000e+00, %0 ], [ %4, %1 ] ; <double> [#uses=1]
%3 = tail call i32 @foo(double 0.0) ; <i32> [#uses=0]
%4 = fadd double %2, -1.000000e+00 ; <double> [#uses=2]
%5 = fcmp ult double %4, 0.000000e+00 ; <i1> [#uses=1]
br i1 %5, label %exit, label %1
exit:
ret void
; CHECK-LABEL: @test5(
; CHECK: icmp slt i32 {{.*}}, 0
; CHECK-NEXT: br i1
}