From e896325ca38a614ece15708dcc3ed9170c6e745d Mon Sep 17 00:00:00 2001 From: Artur Pilipenko Date: Wed, 10 Aug 2016 13:51:01 +0000 Subject: [PATCH] Add a test case for r278217 "[LVI] Relax the assertion about LVILatticeVal type in getConstantRange" llvm-svn: 278226 --- llvm/test/Transforms/CorrelatedValuePropagation/add.ll | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/llvm/test/Transforms/CorrelatedValuePropagation/add.ll b/llvm/test/Transforms/CorrelatedValuePropagation/add.ll index 9f3f99b..f91d0e3 100644 --- a/llvm/test/Transforms/CorrelatedValuePropagation/add.ll +++ b/llvm/test/Transforms/CorrelatedValuePropagation/add.ll @@ -89,3 +89,13 @@ bb: exit: ret void } + +; Check for a corner case where an integer value is represented with a constant +; LVILatticeValue instead of constantrange. Check that we don't fail with an +; assertion in this case. +@b = global i32 0, align 4 +define void @test6(i32 %a) { +bb: + %add = add i32 %a, ptrtoint (i32* @b to i32) + ret void +} -- 2.7.4