missed cast elimination
authorAndrew Lenharth <andrewl@lenharth.org>
Thu, 22 Feb 2007 15:17:45 +0000 (15:17 +0000)
committerAndrew Lenharth <andrewl@lenharth.org>
Thu, 22 Feb 2007 15:17:45 +0000 (15:17 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34490 91177308-0d34-0410-b5e6-96231b3b80d8

test/Transforms/InstCombine/cast_ptr.ll

index 19d3ca6f8e8bc6dc43df84c6617a883f6a5b4ef5..dce62af76694eca99f77275438b30ba84099b8e6 100644 (file)
@@ -1,6 +1,6 @@
 ; Tests to make sure elimination of casts is working correctly
 ; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine -disable-output &&
-; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | not grep '\([sz]ext\)\|\(trunc\)'
+; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | not grep '\([sz]ext\)\|\(trunc\)|\(ptrtoint\)'
 
 target pointersize = 32
 
@@ -13,3 +13,9 @@ sbyte* %test1(sbyte* %t) {
        ret sbyte* %tv
 }
 
+bool %test2(sbyte* %a, sbyte* %b) {
+%tmpa = cast sbyte* %a to uint
+%tmpb = cast sbyte* %b to uint
+%r = seteq uint %tmpa, %tmpb
+ret bool %r
+}