diff options
author | Craig Topper <craig.topper@gmail.com> | 2017-06-01 21:20:07 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@gmail.com> | 2017-06-01 21:20:07 +0000 |
commit | 5ea2d55e1c138cb04f87993dfdfe3f1edeb96e1f (patch) | |
tree | 568d85141d1f9779b2b05684e1728fa36dff7edc | |
parent | d819d5bd68446e8a0e298112e95cb6f621bd1b0d (diff) | |
download | bcm5719-llvm-5ea2d55e1c138cb04f87993dfdfe3f1edeb96e1f.tar.gz bcm5719-llvm-5ea2d55e1c138cb04f87993dfdfe3f1edeb96e1f.zip |
[InstSimplify][ConstantFolding] Add test demonstrating failure to simplify (icmp eq null, inttoptr x) when the null is on the left hand side. NFC
llvm-svn: 304474
-rw-r--r-- | llvm/test/Transforms/InstSimplify/compare.ll | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstSimplify/compare.ll b/llvm/test/Transforms/InstSimplify/compare.ll index d6f1b634102..9125367a7bf 100644 --- a/llvm/test/Transforms/InstSimplify/compare.ll +++ b/llvm/test/Transforms/InstSimplify/compare.ll @@ -1278,3 +1278,19 @@ define void @icmp_slt_sge_or(i32 %Ax, i32 %Bx) { ; CHECK: call void @helper_i1(i1 true) ret void } + +define i1 @constant_fold_inttoptr_null() { +; CHECK-LABEL: @constant_fold_inttoptr_null( +; CHECK-NEXT: ret i1 false +; + %x = icmp eq i32* inttoptr (i64 32 to i32*), null + ret i1 %x +} + +define i1 @constant_fold_null_inttoptr() { +; CHECK-LABEL: @constant_fold_null_inttoptr( +; CHECK-NEXT: ret i1 icmp eq (i32* inttoptr (i64 32 to i32*), i32* null) +; + %x = icmp eq i32* null, inttoptr (i64 32 to i32*) + ret i1 %x +} |