X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=test%2FTransforms%2FReassociate%2Fotherops.ll;h=7718881d8e51eaaee8ce6eefcd52d14def8e8bc5;hb=6cad61163ade8148723b33964d60e31896dc5df7;hp=9e99d2c858910865d840ba6889ac8562a6fcb72b;hpb=69ccadd7535a83b348595cf603126e6a68b2883b;p=oota-llvm.git diff --git a/test/Transforms/Reassociate/otherops.ll b/test/Transforms/Reassociate/otherops.ll index 9e99d2c8589..7718881d8e5 100644 --- a/test/Transforms/Reassociate/otherops.ll +++ b/test/Transforms/Reassociate/otherops.ll @@ -1,28 +1,42 @@ ; Reassociation should apply to Add, Mul, And, Or, & Xor ; -; RUN: llvm-upgrade < %s | llvm-as | opt -reassociate -constprop -instcombine -die | llvm-dis | not grep 12 +; RUN: opt < %s -reassociate -constprop -instcombine -die -S | FileCheck %s -int "test_mul"(int %arg) { - %tmp1 = mul int 12, %arg - %tmp2 = mul int %tmp1, 12 - ret int %tmp2 -} +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 +}