1; RUN: opt -instsimplify -S < %s | FileCheck %s
2
3define i1 @bitcast() {
4; CHECK-LABEL: @bitcast(
5  %a = alloca i32
6  %b = alloca i64
7  %x = bitcast i32* %a to i8*
8  %z = bitcast i64* %b to i8*
9  %y = call i8* @func1(i8* %z)
10  %cmp = icmp eq i8* %x, %y
11  ret i1 %cmp
12; CHECK-NEXT: ret i1 false
13}
14
15%gept = type { i32, i32 }
16
17define i1 @gep3() {
18; CHECK-LABEL: @gep3(
19  %x = alloca %gept, align 8
20  %a = getelementptr %gept, %gept* %x, i64 0, i32 0
21  %y = call %gept* @func2(%gept* %x)
22  %b = getelementptr %gept, %gept* %y, i64 0, i32 1
23  %equal = icmp eq i32* %a, %b
24  ret i1 %equal
25; CHECK-NEXT: ret i1 false
26}
27
28declare i8* @func1(i8* returned) nounwind readnone willreturn
29declare %gept* @func2(%gept* returned) nounwind readnone willreturn
30
31