Use InstrSlots::NUM rather than pre-dividing by four. Also, mark this const.
[oota-llvm.git] / test / Analysis / LoadVN / casts.ll
index 462338d0d84e07c7d405cd0e239b46c22e532d5a..70e3fe56805c7a8c17b7d202c50af68ffb86a757 100644 (file)
@@ -1,12 +1,13 @@
 ; Check to make sure that Value Numbering doesn't merge casts of different
 ; flavors.
-; RUN: llvm-as < %s | opt -load-vn -gcse | llvm-dis | grep '[sz]ext' | wc -l | grep 2
+; RUN: llvm-as < %s | opt -load-vn -gcse | llvm-dis | \
+; RUN:   grep {\[sz\]ext} | count 2
 
-declare void %external(int)
+declare void @external(i32)
 
-int %test_casts(short %x) {
-  %a = sext short %x to int
-  %b = zext short %x to int
-  call void %external(int %a)
-  ret int %b
+define i32 @test_casts(i16 %x) {
+       %a = sext i16 %x to i32         ; <i32> [#uses=1]
+       %b = zext i16 %x to i32         ; <i32> [#uses=1]
+       call void @external( i32 %a )
+       ret i32 %b
 }