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
6 define internal void @dead() {
7 ; CGSCC-LABEL: define {{[^@]+}}@dead() {
8 ; CGSCC-NEXT: [[TMP1:%.*]] = call i32 @test()
11 call i32 @test(ptr null, ptr null)
15 define internal i32 @test(ptr %X, ptr %Y) {
16 ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)
17 ; CGSCC-LABEL: define {{[^@]+}}@test
18 ; CGSCC-SAME: () #[[ATTR0:[0-9]+]] {
19 ; CGSCC-NEXT: br i1 true, label [[LIVE:%.*]], label [[DEAD:%.*]]
21 ; CGSCC-NEXT: ret i32 undef
23 ; CGSCC-NEXT: unreachable
25 br i1 true, label %live, label %dead
30 call i32 @caller(ptr null)
35 define internal i32 @caller(ptr %B) {
36 ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)
37 ; CGSCC-LABEL: define {{[^@]+}}@caller
38 ; CGSCC-SAME: () #[[ATTR0]] {
39 ; CGSCC-NEXT: [[A:%.*]] = alloca i32, align 4
40 ; CGSCC-NEXT: [[A1:%.*]] = alloca i8, i32 0, align 4
41 ; CGSCC-NEXT: ret i32 0
45 %C = call i32 @test(ptr %A, ptr %B)
49 define i32 @callercaller() {
50 ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)
51 ; TUNIT-LABEL: define {{[^@]+}}@callercaller
52 ; TUNIT-SAME: () #[[ATTR0:[0-9]+]] {
53 ; TUNIT-NEXT: [[B:%.*]] = alloca i32, align 4
54 ; TUNIT-NEXT: ret i32 0
56 ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
57 ; CGSCC-LABEL: define {{[^@]+}}@callercaller
58 ; CGSCC-SAME: () #[[ATTR1:[0-9]+]] {
59 ; CGSCC-NEXT: [[B:%.*]] = alloca i32, align 4
60 ; CGSCC-NEXT: [[X:%.*]] = call noundef i32 @caller() #[[ATTR2:[0-9]+]]
61 ; CGSCC-NEXT: ret i32 [[X]]
65 %X = call i32 @caller(ptr %B)
70 ; TUNIT: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) }
72 ; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) }
73 ; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree nosync nounwind willreturn memory(none) }
74 ; CGSCC: attributes #[[ATTR2]] = { nofree nosync willreturn }
76 ;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line: