46 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; See PR267746 7define i32 @baz() {8; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)9; CHECK-LABEL: define {{[^@]+}}@baz10; CHECK-SAME: () #[[ATTR0:[0-9]+]] {11; CHECK-NEXT: ret i32 1012;13 ret i32 1014}15 16; We can const-prop @baz's return value *into* @foo, but cannot17; constprop @foo's return value into bar.18 19define linkonce_odr i32 @foo() {20; TUNIT-LABEL: define {{[^@]+}}@foo() {21; TUNIT-NEXT: ret i32 1022;23; CGSCC-LABEL: define {{[^@]+}}@foo() {24; CGSCC-NEXT: [[VAL:%.*]] = call i32 @baz()25; CGSCC-NEXT: ret i32 [[VAL]]26;27 28 %val = call i32 @baz()29 ret i32 %val30}31 32define i32 @bar() {33; CHECK-LABEL: define {{[^@]+}}@bar() {34; CHECK-NEXT: [[VAL:%.*]] = call i32 @foo()35; CHECK-NEXT: ret i32 [[VAL]]36;37 38 %val = call i32 @foo()39 ret i32 %val40}41;.42; TUNIT: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) }43;.44; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) }45;.46