1 ; RUN: opt -S -mergefunc < %s | FileCheck %s
3 %Opaque_type = type opaque
4 %S2i = type <{ i64, i64 }>
5 %D2i = type <{ i64, i64 }>
9 define void @B(%Opaque_type* sret %a, %S2i* %b, i32* %xp, i32* %yp) {
10 %x = load i32, i32* %xp
11 %y = load i32, i32* %yp
13 %sum2 = add i32 %sum, %y
14 %sum3 = add i32 %sum2, %y
18 define void @C(%Opaque_type* sret %a, %S2i* %b, i32* %xp, i32* %yp) {
19 %x = load i32, i32* %xp
20 %y = load i32, i32* %yp
22 %sum2 = add i32 %sum, %y
23 %sum3 = add i32 %sum2, %y
27 define void @A(%Opaque_type* sret %a, %D2i* %b, i32* %xp, i32* %yp) {
28 %x = load i32, i32* %xp
29 %y = load i32, i32* %yp
31 %sum2 = add i32 %sum, %y
32 %sum3 = add i32 %sum2, %y
36 ; Make sure we transfer the parameter attributes to the call site.
37 ; CHECK-LABEL: define void @C(%Opaque_type* sret
38 ; CHECK: tail call void bitcast (void (%Opaque_type*, %D2i*, i32*, i32*)* @A to void (%Opaque_type*, %S2i*, i32*, i32*)*)(%Opaque_type* sret %0, %S2i* %1, i32* %2, i32* %3)
42 ; Make sure we transfer the parameter attributes to the call site.
43 ; CHECK-LABEL: define void @B(%Opaque_type* sret
45 ; CHECK: tail call void @A(%Opaque_type* sret %0, %D2i* %5, i32* %2, i32* %3)