1; RUN: opt -S -passes=mergefunc < %s | FileCheck %s 2 3%Opaque_type = type opaque 4%S2i = type <{ i64, i64 }> 5%D2i = type <{ i64, i64 }> 6%Di = type <{ i32 }> 7%Si = type <{ i32 }> 8 9define void @B(ptr sret(%Opaque_type) %a, ptr %b, ptr %xp, ptr %yp) { 10 %x = load i32, ptr %xp 11 %y = load i32, ptr %yp 12 %sum = add i32 %x, %y 13 %sum2 = add i32 %sum, %y 14 %sum3 = add i32 %sum2, %y 15 ret void 16} 17 18define void @C(ptr sret(%Opaque_type) %a, ptr %b, ptr %xp, ptr %yp) { 19 %x = load i32, ptr %xp 20 %y = load i32, ptr %yp 21 %sum = add i32 %x, %y 22 %sum2 = add i32 %sum, %y 23 %sum3 = add i32 %sum2, %y 24 ret void 25} 26 27define void @A(ptr sret(%Opaque_type) %a, ptr %b, ptr %xp, ptr %yp) { 28 %x = load i32, ptr %xp 29 %y = load i32, ptr %yp 30 %sum = add i32 %x, %y 31 %sum2 = add i32 %sum, %y 32 %sum3 = add i32 %sum2, %y 33 ret void 34} 35 36; Make sure we transfer the parameter attributes to the call site. 37; CHECK-LABEL: define void @C(ptr sret 38; CHECK: tail call void @A(ptr sret(%Opaque_type) %0, ptr %1, ptr %2, ptr %3) 39; CHECK: ret void 40 41 42; Make sure we transfer the parameter attributes to the call site. 43; CHECK-LABEL: define void @B(ptr sret 44; CHECK: tail call void @A(ptr sret(%Opaque_type) %0, ptr %1, ptr %2, ptr %3) 45; CHECK: ret void 46 47