1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals
2 ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,TUNIT
3 ; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC
8 ; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)
9 ; CHECK-LABEL: define {{[^@]+}}@baz
10 ; CHECK-SAME: () #[[ATTR0:[0-9]+]] {
11 ; CHECK-NEXT: ret i32 10
16 ; We can const-prop @baz's return value *into* @foo, but cannot
17 ; constprop @foo's return value into bar.
19 define linkonce_odr i32 @foo() {
20 ; TUNIT-LABEL: define {{[^@]+}}@foo() {
21 ; TUNIT-NEXT: ret i32 10
23 ; CGSCC-LABEL: define {{[^@]+}}@foo() {
24 ; CGSCC-NEXT: [[VAL:%.*]] = call i32 @baz()
25 ; CGSCC-NEXT: ret i32 [[VAL]]
28 %val = call i32 @baz()
33 ; CHECK-LABEL: define {{[^@]+}}@bar() {
34 ; CHECK-NEXT: [[VAL:%.*]] = call i32 @foo()
35 ; CHECK-NEXT: ret i32 [[VAL]]
38 %val = call i32 @foo()
42 ; TUNIT: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) }
44 ; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) }