X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=test%2FTransforms%2FReassociate%2Fotherops.ll;h=7718881d8e51eaaee8ce6eefcd52d14def8e8bc5;hb=12d60e9e7c149a7d333e277dfbe25a720c88c585;hp=7182e1f72acea65299ff3724378c35c05ae7b565;hpb=557a143b8276ef8e07f2e873d7a2988106474e9a;p=oota-llvm.git diff --git a/test/Transforms/Reassociate/otherops.ll b/test/Transforms/Reassociate/otherops.ll index 7182e1f72ac..7718881d8e5 100644 --- a/test/Transforms/Reassociate/otherops.ll +++ b/test/Transforms/Reassociate/otherops.ll @@ -1,31 +1,42 @@ ; Reassociation should apply to Add, Mul, And, Or, & Xor ; -; RUN: if as < %s | opt -reassociate -constprop -instcombine -die | dis | grep 12 -; RUN: then exit 1 -; RUN: else exit 0 -; RUN: fi - -int "test_mul"(int %arg) { - %tmp1 = mul int 12, %arg - %tmp2 = mul int %tmp1, 12 - ret int %tmp2 -} +; RUN: opt < %s -reassociate -constprop -instcombine -die -S | FileCheck %s + +define i32 @test_mul(i32 %arg) { +; CHECK-LABEL: test_mul +; CHECK-NEXT: %tmp2 = mul i32 %arg, 144 +; CHECK-NEXT: ret i32 %tmp2 -int "test_and"(int %arg) { - %tmp1 = and int 14, %arg - %tmp2 = and int %tmp1, 14 - ret int %tmp2 + %tmp1 = mul i32 12, %arg + %tmp2 = mul i32 %tmp1, 12 + ret i32 %tmp2 } -int "test_or"(int %arg) { - %tmp1 = or int 14, %arg - %tmp2 = or int %tmp1, 14 - ret int %tmp2 +define i32 @test_and(i32 %arg) { +; CHECK-LABEL: test_and +; CHECK-NEXT: %tmp2 = and i32 %arg, 14 +; CHECK-NEXT: ret i32 %tmp2 + + %tmp1 = and i32 14, %arg + %tmp2 = and i32 %tmp1, 14 + ret i32 %tmp2 } -int "test_xor"(int %arg) { - %tmp1 = xor int 12, %arg - %tmp2 = xor int %tmp1, 12 - ret int %tmp2 +define i32 @test_or(i32 %arg) { +; CHECK-LABEL: test_or +; CHECK-NEXT: %tmp2 = or i32 %arg, 14 +; CHECK-NEXT: ret i32 %tmp2 + + %tmp1 = or i32 14, %arg + %tmp2 = or i32 %tmp1, 14 + ret i32 %tmp2 } +define i32 @test_xor(i32 %arg) { +; CHECK-LABEL: test_xor +; CHECK-NEXT: ret i32 %arg + + %tmp1 = xor i32 12, %arg + %tmp2 = xor i32 %tmp1, 12 + ret i32 %tmp2 +}