56 lines · plain
1; Check that when removing arguments, existing callsite attributes are preserved2 3; RUN: llvm-reduce --abort-on-invalid-reduction --delta-passes=arguments --test FileCheck --test-arg --check-prefixes=INTERESTING --test-arg %s --test-arg --input-file %s -o %t4; RUN: FileCheck --check-prefixes=RESULT %s < %t5 6; INTERESTING-LABEL: define void @callee0(7define void @callee0(ptr %interesting0, ptr %interesting1, i32 %uninteresting2) {8 ret void9}10 11; INTERESTING-LABEL: define void @callee1(12define void @callee1(ptr byval(i64) %interesting0, ptr %interesting1, i32 %uninteresting2) {13 ret void14}15 16; INTERESTING-LABEL: define void @caller0(17 18; INTERESTING: byval19; INTERESTING-SAME: "some-attr"20 21; INTERESTING: byval22; INTERESTING-SAME: "more-attr"23 24; RESULT-LABEL: define void @caller0(ptr %val0) {25; RESULT: call void @callee0(ptr byval(i32) %val0, ptr "some-attr" %alloca0) #026; RESULT: call void @callee1(ptr byval(i64) %alloca1, ptr "more-attr" %alloca1) #127define void @caller0(ptr %val0, i32 %val1) {28 %alloca0 = alloca i3229 %alloca1 = alloca i6430 call void @callee0(ptr byval(i32) %val0, ptr "some-attr" %alloca0, i32 %val1) nounwind memory(none) "a-func-attr"31 call void @callee1(ptr byval(i64) %alloca1, ptr "more-attr" %alloca1, i32 9) "val-func-attr="="something"32 ret void33}34 35; RESULT-LABEL: define ptr @callee2() {36; RESULT-NEXT: ret ptr null37define ptr @callee2(ptr %val0, i32 %b) {38 store i32 %b, ptr %val039 ret ptr %val040}41 42; Make sure ret attributes are preserved43; INTERESTING: define ptr @caller1(44; INTERESTING: call45 46; RESULT-LABEL: define ptr @caller1() {47; RESULT: %ret = call align 4 "ret-attr" ptr @callee2()48 49define ptr @caller1(ptr %val0, i32 %val1) {50 %ret = call align 4 "ret-attr" ptr @callee2(ptr %val0, i32 %val1)51 ret ptr %ret52}53 54; RESULT: attributes #0 = { nounwind memory(none) "a-func-attr" }55; RESULT: attributes #1 = { "val-func-attr="="something" }56