1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 12:12:47 +01:00
llvm-mirror/test/Transforms/InstSimplify/cast.ll
David Majnemer 0ee8edb96e Reapply: [InstSimplify] Add support for bitcasts"
This reverts commit r276700 and reapplies r276698.
The relevant clang tests have been updated.

llvm-svn: 276727
2016-07-26 05:52:29 +00:00

28 lines
508 B
LLVM

; RUN: opt -S -instsimplify < %s | FileCheck %s
define i1 @test1(i1 %V) {
entry:
%Z = zext i1 %V to i32
%T = trunc i32 %Z to i1
ret i1 %T
; CHECK-LABEL: define i1 @test1(
; CHECK: ret i1 %V
}
define i8* @test2(i8* %V) {
entry:
%BC1 = bitcast i8* %V to i32*
%BC2 = bitcast i32* %BC1 to i8*
ret i8* %BC2
; CHECK-LABEL: define i8* @test2(
; CHECK: ret i8* %V
}
define i8* @test3(i8* %V) {
entry:
%BC = bitcast i8* %V to i8*
ret i8* %BC
; CHECK-LABEL: define i8* @test3(
; CHECK: ret i8* %V
}