1 ; RUN: opt < %s -instcombine -S | FileCheck %s 2 3 target datalayout = "e-p:32:32" 4 target triple = "i686-pc-linux-gnu" 5 6 define i32 @main() { 7 ; CHECK-LABEL: @main( 8 ; CHECK: %[[call:.*]] = call i7* @ctime(i999* null) 9 ; CHECK: %[[cast:.*]] = ptrtoint i7* %[[call]] to i32 10 ; CHECK: ret i32 %[[cast]] 11 entry: 12 %tmp = call i32 bitcast (i7* (i999*)* @ctime to i32 (i99*)*)( i99* null ) 13 ret i32 %tmp 14 } 15 16 define i7* @ctime(i999*) { 17 ; CHECK-LABEL: define i7* @ctime( 18 ; CHECK: %[[call:.*]] = call i32 @main() 19 ; CHECK: %[[cast:.*]] = inttoptr i32 %[[call]] to i7* 20 entry: 21 %tmp = call i7* bitcast (i32 ()* @main to i7* ()*)( ) 22 ret i7* %tmp 23 } 24