1 ; RUN: opt < %s -instcombine -S | FileCheck %s
3 target datalayout = "e-p:32:32"
4 target triple = "i686-pc-win32"
7 declare token @llvm.call.preallocated.setup(i32)
8 declare i8* @llvm.call.preallocated.arg(token, i32)
10 declare void @takes_i32(i32)
11 declare void @takes_i32_preallocated(i32* preallocated(i32))
14 ; CHECK-LABEL: define void @f()
15 %t = call token @llvm.call.preallocated.setup(i32 1)
16 %a = call i8* @llvm.call.preallocated.arg(token %t, i32 0) preallocated(i32)
17 %arg = bitcast i8* %a to i32*
18 call void bitcast (void (i32)* @takes_i32 to void (i32*)*)(i32* preallocated(i32) %arg) ["preallocated"(token %t)]
19 ; CHECK: call void bitcast{{.*}}@takes_i32
24 ; CHECK-LABEL: define void @g()
25 call void bitcast (void (i32*)* @takes_i32_preallocated to void (i32)*)(i32 0)
26 ; CHECK: call void bitcast{{.*}}@takes_i32_preallocated