summaryrefslogtreecommitdiffstats
path: root/test/Transforms/InstCombine/cast2.ll
diff options
context:
space:
mode:
Diffstat (limited to 'test/Transforms/InstCombine/cast2.ll')
-rw-r--r--test/Transforms/InstCombine/cast2.ll9
1 files changed, 8 insertions, 1 deletions
diff --git a/test/Transforms/InstCombine/cast2.ll b/test/Transforms/InstCombine/cast2.ll
index 5cc9087..0ae869f 100644
--- a/test/Transforms/InstCombine/cast2.ll
+++ b/test/Transforms/InstCombine/cast2.ll
@@ -1,5 +1,5 @@
; Tests to make sure elimination of casts is working correctly
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | notcast
+; RUN: opt < %s -instcombine -S | FileCheck %s
define i16 @test1(i16 %a) {
%tmp = zext i16 %a to i32 ; <i32> [#uses=2]
@@ -8,6 +8,8 @@ define i16 @test1(i16 %a) {
%tmp.upgrd.32 = or i32 %tmp21, %tmp5 ; <i32> [#uses=1]
%tmp.upgrd.3 = trunc i32 %tmp.upgrd.32 to i16 ; <i16> [#uses=1]
ret i16 %tmp.upgrd.3
+; CHECK: %tmp.upgrd.32 = call i16 @llvm.bswap.i16(i16 %a)
+; CHECK: ret i16 %tmp.upgrd.32
}
define i16 @test2(i16 %a) {
@@ -17,6 +19,10 @@ define i16 @test2(i16 %a) {
%tmp.upgrd.32 = or i32 %tmp21, %tmp5 ; <i32> [#uses=1]
%tmp.upgrd.3 = trunc i32 %tmp.upgrd.32 to i16 ; <i16> [#uses=1]
ret i16 %tmp.upgrd.3
+; CHECK: %tmp21 = lshr i16 %a, 9
+; CHECK: %tmp5 = shl i16 %a, 8
+; CHECK: %tmp.upgrd.32 = or i16 %tmp21, %tmp5
+; CHECK: ret i16 %tmp.upgrd.32
}
; PR1263
@@ -24,6 +30,7 @@ define i32* @test3(i32* %tmp1) {
%tmp64 = bitcast i32* %tmp1 to { i32 }* ; <{ i32 }*> [#uses=1]
%tmp65 = getelementptr { i32 }* %tmp64, i32 0, i32 0 ; <i32*> [#uses=1]
ret i32* %tmp65
+; CHECK: ret i32* %tmp1
}
OpenPOWER on IntegriCloud