Extend 'readonly' and 'readnone' to work on function arguments as well as
[oota-llvm.git] / test / Transforms / InstCombine / zext.ll
index 27442aab613311e2c5c46a7c13d7d8a67032d666..10eabf7aed46a63bfc8f8cc21baa3162d212b8c1 100644 (file)
@@ -1,9 +1,11 @@
 ; Tests to make sure elimination of casts is working correctly
-; RUN: llvm-as < %s | opt -instcombine -disable-output &&
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | notcast '' '%c1.*'
+; RUN: opt < %s -instcombine -S | FileCheck %s
 
-long %test_sext_zext(short %A) {
-    %c1 = zext short %A to uint
-    %c2 = sext uint %c1 to long
-    ret long %c2
+define i64 @test_sext_zext(i16 %A) {
+        %c1 = zext i16 %A to i32                ; <i32> [#uses=1]
+        %c2 = sext i32 %c1 to i64               ; <i64> [#uses=1]
+        ret i64 %c2
+; CHECK-NOT: %c1
+; CHECK: %c2 = zext i16 %A to i64
+; CHECK: ret i64 %c2
 }