diff options
| author | Roman Lebedev <lebedev.ri@gmail.com> | 2018-06-07 21:19:45 +0000 |
|---|---|---|
| committer | Roman Lebedev <lebedev.ri@gmail.com> | 2018-06-07 21:19:45 +0000 |
| commit | fdd90f2fc640c65bdedc39636b56d6ce435ec813 (patch) | |
| tree | 19add713b5cb49f9575495696354c8e8b8bee373 | |
| parent | 111d0b2aece730d6cc2be9c55e30b80d9035ed7e (diff) | |
| download | bcm5719-llvm-fdd90f2fc640c65bdedc39636b56d6ce435ec813.tar.gz bcm5719-llvm-fdd90f2fc640c65bdedc39636b56d6ce435ec813.zip | |
[NFC][InstSimplify] One more negative test for shl nuw C, %x -> C fold.
Follow-up for rL334200, rL334206.
llvm-svn: 334235
| -rw-r--r-- | llvm/test/Transforms/InstSimplify/constantfold-shl-nuw-C-to-C.ll | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/llvm/test/Transforms/InstSimplify/constantfold-shl-nuw-C-to-C.ll b/llvm/test/Transforms/InstSimplify/constantfold-shl-nuw-C-to-C.ll index 468a69916b0..5103d70c4ea 100644 --- a/llvm/test/Transforms/InstSimplify/constantfold-shl-nuw-C-to-C.ll +++ b/llvm/test/Transforms/InstSimplify/constantfold-shl-nuw-C-to-C.ll @@ -108,12 +108,21 @@ define i8 @shl_127 (i8 %x) { ret i8 %ret } +define i8 @bad_shl (i8 %x) { +; CHECK-LABEL: @bad_shl( +; CHECK-NEXT: [[RET:%.*]] = shl i8 -1, [[X:%.*]] +; CHECK-NEXT: ret i8 [[RET]] +; + %ret = shl i8 -1, %x ; need nuw + ret i8 %ret +} + define i8 @bad_nsw (i8 %x) { ; CHECK-LABEL: @bad_nsw( ; CHECK-NEXT: [[RET:%.*]] = shl nsw i8 -1, [[X:%.*]] ; CHECK-NEXT: ret i8 [[RET]] ; - %ret = shl nsw i8 -1, %x + %ret = shl nsw i8 -1, %x ; need nuw ret i8 %ret } |

