diff options
author | James Molloy <james.molloy@arm.com> | 2015-02-13 11:08:40 +0000 |
---|---|---|
committer | James Molloy <james.molloy@arm.com> | 2015-02-13 11:08:40 +0000 |
commit | 5eb75aced47251ff5afe901da80836e8e0820376 (patch) | |
tree | 64249956b35f05e35c7d0bcd1cf886a9df0974a2 /llvm/test/Transforms | |
parent | c9a475d4479365f707b671ea21b14488af4eeead (diff) | |
download | bcm5719-llvm-5eb75aced47251ff5afe901da80836e8e0820376.tar.gz bcm5719-llvm-5eb75aced47251ff5afe901da80836e8e0820376.zip |
[SimplifyCFG] Add test for r229099
Add extra test that was accidentally not staged.
llvm-svn: 229101
Diffstat (limited to 'llvm/test/Transforms')
-rw-r--r-- | llvm/test/Transforms/SimplifyCFG/clamp.ll | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/llvm/test/Transforms/SimplifyCFG/clamp.ll b/llvm/test/Transforms/SimplifyCFG/clamp.ll new file mode 100644 index 00000000000..d21894a1269 --- /dev/null +++ b/llvm/test/Transforms/SimplifyCFG/clamp.ll @@ -0,0 +1,22 @@ +; RUN: opt < %s -simplifycfg -S | FileCheck %s + +define float @clamp(float %a, float %b, float %c) { +; CHECK-LABEL: @clamp +; CHECK: %cmp = fcmp ogt float %a, %c +; CHECK: %cmp1 = fcmp olt float %a, %b +; CHECK: %cond = select i1 %cmp1, float %b, float %a +; CHECK: %cond5 = select i1 %cmp, float %c, float %cond +; CHECK: ret float %cond5 +entry: + %cmp = fcmp ogt float %a, %c + br i1 %cmp, label %cond.end4, label %cond.false + +cond.false: ; preds = %entry + %cmp1 = fcmp olt float %a, %b + %cond = select i1 %cmp1, float %b, float %a + br label %cond.end4 + +cond.end4: ; preds = %entry, %cond.false + %cond5 = phi float [ %cond, %cond.false ], [ %c, %entry ] + ret float %cond5 +} |