1 ; RUN: opt < %s -instcombine -S | FileCheck %s
3 declare i32 @f32(i32**, i32**)
5 declare i32 @f64(i64**, i64**)
7 define i1 @icmp_func() {
8 ; CHECK-LABEL: @icmp_func(
10 %cmp = icmp eq i32 (i8*, i8*)* bitcast (i32 (i32**, i32**)* @f32 to i32 (i8*, i8*)*), bitcast (i32 (i64**, i64**)* @f64 to i32 (i8*, i8*)*)
14 define i1 @icmp_fptr(i32 (i8*, i8*)*) {
15 ; CHECK-LABEL: @icmp_fptr(
16 ; CHECK: %cmp = icmp ne i32 (i8*, i8*)* %0, bitcast (i32 (i32**, i32**)* @f32 to i32 (i8*, i8*)*)
18 %cmp = icmp ne i32 (i8*, i8*)* bitcast (i32 (i32**, i32**)* @f32 to i32 (i8*, i8*)*), %0
22 @b = external global i32
24 define i32 @icmp_glob(i32 %x, i32 %y) {
25 ; CHECK-LABEL: define i32 @icmp_glob(i32 %x, i32 %y)
26 ; CHECK-NEXT: ret i32 %y
28 %sel = select i1 icmp eq (i32* bitcast (i32 (i32, i32)* @icmp_glob to i32*), i32* @b), i32 %x, i32 %y