1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals
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
7 define internal i32 @testf(i1 %c) {
8 ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
9 ; IS__CGSCC____-LABEL: define {{[^@]+}}@testf
10 ; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR0:[0-9]+]] {
11 ; IS__CGSCC____-NEXT: entry:
12 ; IS__CGSCC____-NEXT: br i1 [[C]], label [[IF_COND:%.*]], label [[IF_END:%.*]]
13 ; IS__CGSCC____: if.cond:
14 ; IS__CGSCC____-NEXT: unreachable
15 ; IS__CGSCC____: if.then:
16 ; IS__CGSCC____-NEXT: unreachable
17 ; IS__CGSCC____: if.end:
18 ; IS__CGSCC____-NEXT: ret i32 undef
21 br i1 %c, label %if.cond, label %if.end
24 br i1 undef, label %if.then, label %if.end
26 if.then: ; preds = %entry, %if.then
29 if.end: ; preds = %if.then1, %entry
33 define internal i32 @test1(i1 %c) {
34 ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
35 ; IS__CGSCC____-LABEL: define {{[^@]+}}@test1
36 ; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR0]] {
37 ; IS__CGSCC____-NEXT: entry:
38 ; IS__CGSCC____-NEXT: br label [[IF_THEN:%.*]]
39 ; IS__CGSCC____: if.then:
40 ; IS__CGSCC____-NEXT: br label [[RET1:%.*]]
41 ; IS__CGSCC____: ret1:
42 ; IS__CGSCC____-NEXT: ret i32 undef
43 ; IS__CGSCC____: ret2:
44 ; IS__CGSCC____-NEXT: unreachable
49 if.then: ; preds = %entry, %if.then
50 %call = call i32 @testf(i1 %c)
51 %res = icmp eq i32 %call, 10
52 br i1 %res, label %ret1, label %ret2
54 ret1: ; preds = %if.then, %entry
57 ret2: ; preds = %if.then, %entry
61 define i32 @main(i1 %c) {
62 ; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn
63 ; IS__TUNIT____-LABEL: define {{[^@]+}}@main
64 ; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR0:[0-9]+]] {
65 ; IS__TUNIT____-NEXT: ret i32 99
67 ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
68 ; IS__CGSCC____-LABEL: define {{[^@]+}}@main
69 ; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR0]] {
70 ; IS__CGSCC____-NEXT: ret i32 99
72 %res = call i32 @test1(i1 %c)
76 ; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn }
78 ; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn }