1 ; RUN: opt -S -instcombine %s | FileCheck %s
3 declare void @add_byval_callee(double*)
5 ; CHECK-LABEL: define void @add_byval
6 ; CHECK: [[ARG:%.*]] = bitcast i64* %in to double*
7 ; CHECK: call void @add_byval_callee(double* byval(double) [[ARG]])
8 define void @add_byval(i64* %in) {
9 %tmp = bitcast void (double*)* @add_byval_callee to void (i64*)*
10 call void %tmp(i64* byval(i64) %in)
16 ; CHECK-LABEL: define void @vararg_byval
17 ; CHECK: call void (i8, ...) @vararg_callee(i8 undef, i8* byval(i8) %p)
18 define void @vararg_byval(i8* %p) {
19 %tmp = bitcast i8* %p to %t2*
20 call void (i8, ...) @vararg_callee(i8 undef, %t2* byval(%t2) %tmp)
24 declare void @vararg_callee(i8, ...)