38 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals2; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,TUNIT3; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC4 5; Should not propagate the result of a weak function.6; PR24117 8define weak i32 @foo() nounwind {9; CHECK: Function Attrs: nounwind10; CHECK-LABEL: define {{[^@]+}}@foo11; CHECK-SAME: () #[[ATTR0:[0-9]+]] {12; CHECK-NEXT: entry:13; CHECK-NEXT: ret i32 114;15entry:16 ret i32 117}18 19define i32 @main() nounwind {20; CHECK: Function Attrs: nounwind21; CHECK-LABEL: define {{[^@]+}}@main22; CHECK-SAME: () #[[ATTR0]] {23; CHECK-NEXT: entry:24; CHECK-NEXT: [[R:%.*]] = call i32 @foo() #[[ATTR0]]25; CHECK-NEXT: ret i32 [[R]]26;27entry:28 %r = call i32 @foo( ) nounwind29 ret i32 %r30}31 32;.33; CHECK: attributes #[[ATTR0]] = { nounwind }34;.35;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:36; CGSCC: {{.*}}37; TUNIT: {{.*}}38