diff options
Diffstat (limited to 'test/Transforms')
-rw-r--r-- | test/Transforms/InstCombine/logical-select.ll | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/test/Transforms/InstCombine/logical-select.ll b/test/Transforms/InstCombine/logical-select.ll index ece8bc3..4e48b2d 100644 --- a/test/Transforms/InstCombine/logical-select.ll +++ b/test/Transforms/InstCombine/logical-select.ll @@ -1,7 +1,4 @@ -; RUN: opt < %s -instcombine -S > %t -; RUN: grep select %t | count 5 -; RUN: not grep and %t -; RUN: not grep or %t +; RUN: opt < %s -instcombine -S > FileCheck %s define i32 @foo(i32 %a, i32 %b, i32 %c, i32 %d) nounwind { %e = icmp slt i32 %a, %b @@ -11,6 +8,9 @@ define i32 @foo(i32 %a, i32 %b, i32 %c, i32 %d) nounwind { %i = and i32 %d, %h %j = or i32 %g, %i ret i32 %j +; CHECK: %e = icmp slt i32 %a, %b +; CHECK: %j = select i1 %e, i32 %c, i32 %d +; CHECK: ret i32 %j } define i32 @bar(i32 %a, i32 %b, i32 %c, i32 %d) nounwind { %e = icmp slt i32 %a, %b @@ -20,6 +20,9 @@ define i32 @bar(i32 %a, i32 %b, i32 %c, i32 %d) nounwind { %i = and i32 %d, %h %j = or i32 %i, %g ret i32 %j +; CHECK: %e = icmp slt i32 %a, %b +; CHECK: %j = select i1 %e, i32 %c, i32 %d +; CHECK: ret i32 %j } define i32 @goo(i32 %a, i32 %b, i32 %c, i32 %d) nounwind { entry: @@ -30,6 +33,9 @@ entry: %2 = and i32 %not, %d %3 = or i32 %1, %2 ret i32 %3 +; CHECK: %0 = icmp slt i32 %a, %b +; CHECK: %1 = select i1 %0, i32 %c, i32 %d +; CHECK: ret i32 %1 } define i32 @poo(i32 %a, i32 %b, i32 %c, i32 %d) nounwind { entry: @@ -40,6 +46,9 @@ entry: %2 = and i32 %iftmp, %d %3 = or i32 %1, %2 ret i32 %3 +; CHECK: %0 = icmp slt i32 %a, %b +; CHECK: %1 = select i1 %0, i32 %c, i32 %d +; CHECK: ret i32 %1 } define i32 @par(i32 %a, i32 %b, i32 %c, i32 %d) nounwind { @@ -51,4 +60,7 @@ entry: %2 = and i32 %not, %d %3 = or i32 %1, %2 ret i32 %3 +; CHECK: %0 = icmp slt i32 %a, %b +; CHECK: %1 = select i1 %0, i32 %c, i32 %d +; CHECK: ret i32 %1 } |