diff options
author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2018-01-01 22:44:59 +0000 |
---|---|---|
committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2018-01-01 22:44:59 +0000 |
commit | 7640666ce8121cd221e6a180d0778d6d17650b03 (patch) | |
tree | 566588f06271c2eeb0f583bf69ae8d4efb192bff /test/Transforms | |
parent | 3169e0763d3a49d80aadf6ea58ba1ce9eca74b36 (diff) |
[ValueTracking] Don't assume shift values are in range
Reduced (as best I could...) from oss-fuzz #4857 test case
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321634 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms')
-rw-r--r-- | test/Transforms/InstCombine/udiv-simplify.ll | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/udiv-simplify.ll b/test/Transforms/InstCombine/udiv-simplify.ll index 885a901a7d3..1794e26d389 100644 --- a/test/Transforms/InstCombine/udiv-simplify.ll +++ b/test/Transforms/InstCombine/udiv-simplify.ll @@ -62,3 +62,24 @@ define i32 @PR30366(i1 %a) { %d = udiv i32 %z, zext (i16 shl (i16 1, i16 ptrtoint ([1 x i16]* @b to i16)) to i32) ret i32 %d } + +; OSS-Fuzz #4857 +; https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=4857 +define i177 @ossfuzz_4857(i177 %X, i177 %Y) { +; CHECK-LABEL: @ossfuzz_4857( +; CHECK-NEXT: store i1 false, i1* undef, align 1 +; CHECK-NEXT: ret i177 0 +; + %B5 = udiv i177 %Y, -1 + %B4 = add i177 %B5, -1 + %B2 = add i177 %B4, -1 + %B6 = mul i177 %B5, %B2 + %B3 = add i177 %B2, %B2 + %B9 = xor i177 %B4, %B3 + %B13 = ashr i177 %Y, %B2 + %B22 = add i177 %B9, %B13 + %B1 = udiv i177 %B5, %B6 + %C9 = icmp ult i177 %Y, %B22 + store i1 %C9, i1* undef + ret i177 %B1 +} |