From be55a79941c29fbe575f9afeaceb1f9c7b05b4d2 Mon Sep 17 00:00:00 2001 From: Mehdi Amini Date: Mon, 16 Feb 2015 21:47:50 +0000 Subject: [PATCH] Tests: reformat sitofp.ll and use FileCheck From: Fiona Glaser git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229436 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/Transforms/InstCombine/sitofp.ll | 59 ++++++++++++++++++--------- 1 file changed, 39 insertions(+), 20 deletions(-) diff --git a/test/Transforms/InstCombine/sitofp.ll b/test/Transforms/InstCombine/sitofp.ll index bd31b89f787..48c0d71e783 100644 --- a/test/Transforms/InstCombine/sitofp.ll +++ b/test/Transforms/InstCombine/sitofp.ll @@ -1,28 +1,40 @@ -; RUN: opt < %s -instcombine -S | not grep itofp +; RUN: opt < %s -instcombine -S | FileCheck %s +; CHECK-LABEL: test1 +; CHECK: ret i1 true define i1 @test1(i8 %A) { %B = sitofp i8 %A to double %C = fcmp ult double %B, 128.0 - ret i1 %C ; True! + ret i1 %C } + +; CHECK-LABEL: test2 +; CHECK: ret i1 true define i1 @test2(i8 %A) { %B = sitofp i8 %A to double %C = fcmp ugt double %B, -128.1 - ret i1 %C ; True! + ret i1 %C } +; CHECK-LABEL: test3 +; CHECK: ret i1 true define i1 @test3(i8 %A) { %B = sitofp i8 %A to double %C = fcmp ule double %B, 127.0 - ret i1 %C ; true! + ret i1 %C } +; CHECK-LABEL: test4 +; CHECK: icmp ne i8 %A, 127 +; CHECK-NEXT: ret i1 define i1 @test4(i8 %A) { %B = sitofp i8 %A to double %C = fcmp ult double %B, 127.0 - ret i1 %C ; A != 127 + ret i1 %C } +; CHECK-LABEL: test5 +; CHECK: ret i32 define i32 @test5(i32 %A) { %B = sitofp i32 %A to double %C = fptosi double %B to i32 @@ -31,25 +43,32 @@ define i32 @test5(i32 %A) { ret i32 %E } +; CHECK-LABEL: test6 +; CHECK: and i32 %A, 39 +; CHECK-NEXT: ret i32 define i32 @test6(i32 %A) { - %B = and i32 %A, 7 ; [#uses=1] - %C = and i32 %A, 32 ; [#uses=1] - %D = sitofp i32 %B to double ; [#uses=1] - %E = sitofp i32 %C to double ; [#uses=1] - %F = fadd double %D, %E ; [#uses=1] - %G = fptosi double %F to i32 ; [#uses=1] - ret i32 %G + %B = and i32 %A, 7 + %C = and i32 %A, 32 + %D = sitofp i32 %B to double + %E = sitofp i32 %C to double + %F = fadd double %D, %E + %G = fptosi double %F to i32 + ret i32 %G } -define i32 @test7(i32 %a) nounwind { - %b = sitofp i32 %a to double ; [#uses=1] - %c = fptoui double %b to i32 ; [#uses=1] - ret i32 %c +; CHECK-LABEL: test7 +; CHECK: ret i32 +define i32 @test7(i32 %A) nounwind { + %B = sitofp i32 %A to double + %C = fptoui double %B to i32 + ret i32 %C } -define i32 @test8(i32 %a) nounwind { - %b = uitofp i32 %a to double ; [#uses=1] - %c = fptosi double %b to i32 ; [#uses=1] - ret i32 %c +; CHECK-LABEL: test8 +; CHECK: ret i32 +define i32 @test8(i32 %A) nounwind { + %B = uitofp i32 %A to double + %C = fptosi double %B to i32 + ret i32 %C } -- 2.34.1