19c2074dcSJohannes Doerfert; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals 223dafbb1SJohannes Doerfert; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,TUNIT 3846709b2SNikita Popov; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC 46cc2b1d7SJohannes Doerfert 54f4787e3SNikita Popov%S = type { ptr } 66cc2b1d7SJohannes Doerfert 76cc2b1d7SJohannes Doerfert; Inlining should nuke the invoke (and any inlined calls) here even with 86cc2b1d7SJohannes Doerfert; argument promotion running along with it. 94f4787e3SNikita Popovdefine void @zot() personality ptr @wibble { 10dbbe9b37SJohannes Doerfert; TUNIT: Function Attrs: mustprogress nofree norecurse noreturn nosync nounwind willreturn memory(none) 11846709b2SNikita Popov; TUNIT-LABEL: define {{[^@]+}}@zot 124f4787e3SNikita Popov; TUNIT-SAME: () #[[ATTR0:[0-9]+]] personality ptr @wibble { 13846709b2SNikita Popov; TUNIT-NEXT: bb: 14846709b2SNikita Popov; TUNIT-NEXT: call void @hoge() #[[ATTR2:[0-9]+]] 15846709b2SNikita Popov; TUNIT-NEXT: unreachable 16846709b2SNikita Popov; TUNIT: bb1: 17846709b2SNikita Popov; TUNIT-NEXT: unreachable 18846709b2SNikita Popov; TUNIT: bb2: 19846709b2SNikita Popov; TUNIT-NEXT: unreachable 20e3d646c6Ssstefan1; 21dbbe9b37SJohannes Doerfert; CGSCC: Function Attrs: mustprogress nofree noreturn nosync nounwind willreturn memory(none) 22846709b2SNikita Popov; CGSCC-LABEL: define {{[^@]+}}@zot 234f4787e3SNikita Popov; CGSCC-SAME: () #[[ATTR0:[0-9]+]] personality ptr @wibble { 24846709b2SNikita Popov; CGSCC-NEXT: bb: 25846709b2SNikita Popov; CGSCC-NEXT: call void @hoge() #[[ATTR4:[0-9]+]] 26846709b2SNikita Popov; CGSCC-NEXT: unreachable 27846709b2SNikita Popov; CGSCC: bb1: 28846709b2SNikita Popov; CGSCC-NEXT: unreachable 29846709b2SNikita Popov; CGSCC: bb2: 30846709b2SNikita Popov; CGSCC-NEXT: unreachable 316cc2b1d7SJohannes Doerfert; 326cc2b1d7SJohannes Doerfertbb: 336cc2b1d7SJohannes Doerfert invoke void @hoge() 346cc2b1d7SJohannes Doerfert to label %bb1 unwind label %bb2 356cc2b1d7SJohannes Doerfert 366cc2b1d7SJohannes Doerfertbb1: 376cc2b1d7SJohannes Doerfert unreachable 386cc2b1d7SJohannes Doerfert 396cc2b1d7SJohannes Doerfertbb2: 404f4787e3SNikita Popov %tmp = landingpad { ptr, i32 } 416cc2b1d7SJohannes Doerfert cleanup 426cc2b1d7SJohannes Doerfert unreachable 436cc2b1d7SJohannes Doerfert} 446cc2b1d7SJohannes Doerfert 456cc2b1d7SJohannes Doerfertdefine internal void @hoge() { 46dbbe9b37SJohannes Doerfert; TUNIT: Function Attrs: mustprogress nofree norecurse noreturn nosync nounwind willreturn memory(none) 47846709b2SNikita Popov; TUNIT-LABEL: define {{[^@]+}}@hoge 48846709b2SNikita Popov; TUNIT-SAME: () #[[ATTR0]] { 49846709b2SNikita Popov; TUNIT-NEXT: bb: 50846709b2SNikita Popov; TUNIT-NEXT: unreachable 51e87f10a7SJohannes Doerfert; 52dbbe9b37SJohannes Doerfert; CGSCC: Function Attrs: mustprogress nofree noreturn nosync nounwind willreturn memory(none) 53846709b2SNikita Popov; CGSCC-LABEL: define {{[^@]+}}@hoge 54846709b2SNikita Popov; CGSCC-SAME: () #[[ATTR0]] { 55846709b2SNikita Popov; CGSCC-NEXT: bb: 56846709b2SNikita Popov; CGSCC-NEXT: unreachable 576cc2b1d7SJohannes Doerfert; 586cc2b1d7SJohannes Doerfertbb: 594f4787e3SNikita Popov %tmp = call fastcc ptr @spam(ptr @eggs) 604f4787e3SNikita Popov %tmp1 = call fastcc ptr @spam(ptr @barney) 616cc2b1d7SJohannes Doerfert unreachable 626cc2b1d7SJohannes Doerfert} 636cc2b1d7SJohannes Doerfert 644f4787e3SNikita Popovdefine internal fastcc ptr @spam(ptr %arg) { 65dbbe9b37SJohannes Doerfert; CGSCC: Function Attrs: mustprogress nofree norecurse noreturn nosync nounwind willreturn memory(none) 66846709b2SNikita Popov; CGSCC-LABEL: define {{[^@]+}}@spam 67846709b2SNikita Popov; CGSCC-SAME: () #[[ATTR1:[0-9]+]] { 68846709b2SNikita Popov; CGSCC-NEXT: bb: 69846709b2SNikita Popov; CGSCC-NEXT: unreachable 703ca54f45SJohannes Doerfert; 716cc2b1d7SJohannes Doerfertbb: 726cc2b1d7SJohannes Doerfert unreachable 736cc2b1d7SJohannes Doerfert} 746cc2b1d7SJohannes Doerfert 754f4787e3SNikita Popovdefine internal i1 @eggs(ptr %arg) { 76846709b2SNikita Popov; CGSCC-LABEL: define {{[^@]+}}@eggs 774f4787e3SNikita Popov; CGSCC-SAME: (ptr [[ARG:%.*]]) { 78846709b2SNikita Popov; CGSCC-NEXT: bb: 79846709b2SNikita Popov; CGSCC-NEXT: [[TMP:%.*]] = call zeroext i1 @barney() 80846709b2SNikita Popov; CGSCC-NEXT: unreachable 819c2074dcSJohannes Doerfert; 826cc2b1d7SJohannes Doerfertbb: 834f4787e3SNikita Popov %tmp = call zeroext i1 @barney(ptr %arg) 846cc2b1d7SJohannes Doerfert unreachable 856cc2b1d7SJohannes Doerfert} 866cc2b1d7SJohannes Doerfert 874f4787e3SNikita Popovdefine internal i1 @barney(ptr %arg) { 88dbbe9b37SJohannes Doerfert; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) 89846709b2SNikita Popov; CGSCC-LABEL: define {{[^@]+}}@barney 90846709b2SNikita Popov; CGSCC-SAME: () #[[ATTR2:[0-9]+]] { 91846709b2SNikita Popov; CGSCC-NEXT: bb: 92846709b2SNikita Popov; CGSCC-NEXT: ret i1 undef 933ca54f45SJohannes Doerfert; 946cc2b1d7SJohannes Doerfertbb: 956cc2b1d7SJohannes Doerfert ret i1 undef 966cc2b1d7SJohannes Doerfert} 976cc2b1d7SJohannes Doerfert 986cc2b1d7SJohannes Doerfertdefine i32 @test_inf_promote_caller(i32 %arg) { 99dbbe9b37SJohannes Doerfert; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) 100846709b2SNikita Popov; TUNIT-LABEL: define {{[^@]+}}@test_inf_promote_caller 101846709b2SNikita Popov; TUNIT-SAME: (i32 [[ARG:%.*]]) #[[ATTR1:[0-9]+]] { 102846709b2SNikita Popov; TUNIT-NEXT: bb: 103846709b2SNikita Popov; TUNIT-NEXT: ret i32 0 1043ca54f45SJohannes Doerfert; 105dbbe9b37SJohannes Doerfert; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) 106846709b2SNikita Popov; CGSCC-LABEL: define {{[^@]+}}@test_inf_promote_caller 107846709b2SNikita Popov; CGSCC-SAME: (i32 [[ARG:%.*]]) #[[ATTR3:[0-9]+]] { 108846709b2SNikita Popov; CGSCC-NEXT: bb: 109846709b2SNikita Popov; CGSCC-NEXT: [[TMP:%.*]] = alloca [[S:%.*]], align 8 110*754b93e4SVidhush Singhal; CGSCC-NEXT: [[TMP3:%.*]] = alloca i8, i32 0, align 8 111*754b93e4SVidhush Singhal; CGSCC-NEXT: [[TMP1:%.*]] = alloca [[S]], align 8 112*754b93e4SVidhush Singhal; CGSCC-NEXT: [[TMP14:%.*]] = alloca i8, i32 0, align 8 113846709b2SNikita Popov; CGSCC-NEXT: ret i32 0 1146cc2b1d7SJohannes Doerfert; 1156cc2b1d7SJohannes Doerfertbb: 1166cc2b1d7SJohannes Doerfert %tmp = alloca %S 1176cc2b1d7SJohannes Doerfert %tmp1 = alloca %S 1184f4787e3SNikita Popov %tmp2 = call i32 @test_inf_promote_callee(ptr %tmp, ptr %tmp1) 1196cc2b1d7SJohannes Doerfert 1206cc2b1d7SJohannes Doerfert ret i32 0 1216cc2b1d7SJohannes Doerfert} 1226cc2b1d7SJohannes Doerfert 1234f4787e3SNikita Popovdefine internal i32 @test_inf_promote_callee(ptr %arg, ptr %arg1) { 124dbbe9b37SJohannes Doerfert; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) 125846709b2SNikita Popov; CGSCC-LABEL: define {{[^@]+}}@test_inf_promote_callee 126846709b2SNikita Popov; CGSCC-SAME: () #[[ATTR3]] { 127846709b2SNikita Popov; CGSCC-NEXT: bb: 128846709b2SNikita Popov; CGSCC-NEXT: ret i32 undef 1293ca54f45SJohannes Doerfert; 1306cc2b1d7SJohannes Doerfertbb: 1314f4787e3SNikita Popov %tmp2 = load ptr, ptr %arg1 1324f4787e3SNikita Popov %tmp4 = load ptr, ptr %arg 1334f4787e3SNikita Popov %tmp5 = call i32 @test_inf_promote_callee(ptr %tmp4, ptr %tmp2) 1346cc2b1d7SJohannes Doerfert 1356cc2b1d7SJohannes Doerfert ret i32 0 1366cc2b1d7SJohannes Doerfert} 1376cc2b1d7SJohannes Doerfert 1386cc2b1d7SJohannes Doerfertdeclare i32 @wibble(...) 1399c2074dcSJohannes Doerfert;. 140dbbe9b37SJohannes Doerfert; TUNIT: attributes #[[ATTR0]] = { mustprogress nofree norecurse noreturn nosync nounwind willreturn memory(none) } 141dbbe9b37SJohannes Doerfert; TUNIT: attributes #[[ATTR1]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) } 142b672c602SJohannes Doerfert; TUNIT: attributes #[[ATTR2]] = { noreturn nounwind memory(none) } 1439c2074dcSJohannes Doerfert;. 144dbbe9b37SJohannes Doerfert; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree noreturn nosync nounwind willreturn memory(none) } 145dbbe9b37SJohannes Doerfert; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree norecurse noreturn nosync nounwind willreturn memory(none) } 146dbbe9b37SJohannes Doerfert; CGSCC: attributes #[[ATTR2]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) } 147dbbe9b37SJohannes Doerfert; CGSCC: attributes #[[ATTR3]] = { mustprogress nofree nosync nounwind willreturn memory(none) } 148b672c602SJohannes Doerfert; CGSCC: attributes #[[ATTR4]] = { noreturn nounwind memory(none) } 1499c2074dcSJohannes Doerfert;. 15023333bb6SJohannes Doerfert;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line: 15123333bb6SJohannes Doerfert; CHECK: {{.*}} 152