Johannes Doerfert | 9c2074d | 2021-03-11 23:21:32 -0600 | [diff] [blame] | 1 | ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals |
Arthur Eubanks | 4a10029 | 2020-07-28 17:57:21 -0700 | [diff] [blame] | 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 |
Johannes Doerfert | e2b53a4 | 2020-04-17 21:09:16 -0500 | [diff] [blame] | 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 |
Arthur Eubanks | 4a10029 | 2020-07-28 17:57:21 -0700 | [diff] [blame] | 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 |
Johannes Doerfert | e2b53a4 | 2020-04-17 21:09:16 -0500 | [diff] [blame] | 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 |
Johannes Doerfert | 3da7efe | 2019-11-01 23:37:04 -0500 | [diff] [blame] | 6 | |
| 7 | ; See PR26774 |
| 8 | |
| 9 | define i32 @baz() { |
sstefan1 | e3d646c | 2020-07-19 21:55:43 +0200 | [diff] [blame] | 10 | ; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn |
sstefan1 | 6ce5b74b | 2020-08-29 19:31:13 +0200 | [diff] [blame] | 11 | ; IS__TUNIT____-LABEL: define {{[^@]+}}@baz |
Johannes Doerfert | 9c2074d | 2021-03-11 23:21:32 -0600 | [diff] [blame] | 12 | ; IS__TUNIT____-SAME: () #[[ATTR0:[0-9]+]] { |
sstefan1 | e3d646c | 2020-07-19 21:55:43 +0200 | [diff] [blame] | 13 | ; IS__TUNIT____-NEXT: ret i32 10 |
| 14 | ; |
| 15 | ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn |
sstefan1 | 6ce5b74b | 2020-08-29 19:31:13 +0200 | [diff] [blame] | 16 | ; IS__CGSCC____-LABEL: define {{[^@]+}}@baz |
Johannes Doerfert | 9c2074d | 2021-03-11 23:21:32 -0600 | [diff] [blame] | 17 | ; IS__CGSCC____-SAME: () #[[ATTR0:[0-9]+]] { |
sstefan1 | e3d646c | 2020-07-19 21:55:43 +0200 | [diff] [blame] | 18 | ; IS__CGSCC____-NEXT: ret i32 10 |
Johannes Doerfert | 3da7efe | 2019-11-01 23:37:04 -0500 | [diff] [blame] | 19 | ; |
| 20 | ret i32 10 |
| 21 | } |
| 22 | |
| 23 | ; We can const-prop @baz's return value *into* @foo, but cannot |
| 24 | ; constprop @foo's return value into bar. |
| 25 | |
| 26 | define linkonce_odr i32 @foo() { |
sstefan1 | 6ce5b74b | 2020-08-29 19:31:13 +0200 | [diff] [blame] | 27 | ; CHECK-LABEL: define {{[^@]+}}@foo() { |
Johannes Doerfert | 3da7efe | 2019-11-01 23:37:04 -0500 | [diff] [blame] | 28 | ; CHECK-NEXT: ret i32 10 |
| 29 | ; |
| 30 | |
| 31 | %val = call i32 @baz() |
| 32 | ret i32 %val |
| 33 | } |
| 34 | |
| 35 | define i32 @bar() { |
sstefan1 | 6ce5b74b | 2020-08-29 19:31:13 +0200 | [diff] [blame] | 36 | ; CHECK-LABEL: define {{[^@]+}}@bar() { |
Johannes Doerfert | 3da7efe | 2019-11-01 23:37:04 -0500 | [diff] [blame] | 37 | ; CHECK-NEXT: [[VAL:%.*]] = call i32 @foo() |
| 38 | ; CHECK-NEXT: ret i32 [[VAL]] |
| 39 | ; |
| 40 | |
| 41 | %val = call i32 @foo() |
| 42 | ret i32 %val |
| 43 | } |
Johannes Doerfert | 9c2074d | 2021-03-11 23:21:32 -0600 | [diff] [blame] | 44 | ;. |
| 45 | ; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } |
| 46 | ;. |
| 47 | ; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } |
| 48 | ;. |