1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes
2; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal  -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM
3; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal  -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM
4; RUN: opt -attributor-cgscc -enable-new-pm=0 -attributor-manifest-internal  -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_NPM,IS__CGSCC____,IS________OPM,IS__CGSCC_OPM
5; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal  -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_OPM,IS__CGSCC____,IS________NPM,IS__CGSCC_NPM
6
7; Should not propagate the result of a weak function.
8; PR2411
9
10define weak i32 @foo() nounwind  {
11; CHECK: Function Attrs: nounwind
12; CHECK-LABEL: define {{[^@]+}}@foo
13; CHECK-SAME: () [[ATTR0:#.*]] {
14; CHECK-NEXT:  entry:
15; CHECK-NEXT:    ret i32 1
16;
17entry:
18  ret i32 1
19}
20
21define i32 @main() nounwind  {
22; CHECK: Function Attrs: nounwind
23; CHECK-LABEL: define {{[^@]+}}@main
24; CHECK-SAME: () [[ATTR0]] {
25; CHECK-NEXT:  entry:
26; CHECK-NEXT:    [[R:%.*]] = call i32 @foo() [[ATTR0]]
27; CHECK-NEXT:    ret i32 [[R]]
28;
29entry:
30  %r = call i32 @foo( ) nounwind
31  ret i32 %r
32}
33
34