; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,TUNIT ; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC ; NOT_CGSCC___: @dead_with_blockaddress_users.l = constant [2 x ptr] [ptr inttoptr (i32 1 to ptr), ptr inttoptr (i32 1 to ptr)] ; IS__CGSCC___: @dead_with_blockaddress_users.l = constant [2 x ptr] [ptr blockaddress(@dead_with_blockaddress_users, %lab0), ptr blockaddress(@dead_with_blockaddress_users, %end)] @dead_with_blockaddress_users.l = constant [2 x ptr] [ptr blockaddress(@dead_with_blockaddress_users, %lab0), ptr blockaddress(@dead_with_blockaddress_users, %end)] declare void @no_return_call() nofree noreturn nounwind nosync declare void @normal_call() readnone declare i32 @foo() declare i32 @foo_nounwind() nounwind declare i32 @foo_noreturn_nounwind() noreturn nounwind declare i32 @foo_noreturn() noreturn declare i32 @bar() nosync readnone ; This internal function has no live call sites, so all its BBs are considered dead, ; and nothing should be deduced for it. ;. ; TUNIT: @[[DEAD_WITH_BLOCKADDRESS_USERS_L:[a-zA-Z0-9_$"\\.-]+]] = constant [2 x ptr] [ptr inttoptr (i32 1 to ptr), ptr inttoptr (i32 1 to ptr)] ; TUNIT: @[[A1:[a-zA-Z0-9_$"\\.-]+]] = common global i8 0, align 8 ; TUNIT: @[[A2:[a-zA-Z0-9_$"\\.-]+]] = common global i8 0, align 16 ; TUNIT: @[[E:[a-zA-Z0-9_$"\\.-]+]] = global ptr null ; TUNIT: @[[P:[a-zA-Z0-9_$"\\.-]+]] = global i8 0 ;. ; CGSCC: @[[DEAD_WITH_BLOCKADDRESS_USERS_L:[a-zA-Z0-9_$"\\.-]+]] = constant [2 x ptr] [ptr blockaddress(@dead_with_blockaddress_users, [[LAB0:%.*]]), ptr blockaddress(@dead_with_blockaddress_users, [[END:%.*]])] ; CGSCC: @[[A1:[a-zA-Z0-9_$"\\.-]+]] = common global i8 0, align 8 ; CGSCC: @[[A2:[a-zA-Z0-9_$"\\.-]+]] = common global i8 0, align 16 ; CGSCC: @[[E:[a-zA-Z0-9_$"\\.-]+]] = global ptr null ; CGSCC: @[[P:[a-zA-Z0-9_$"\\.-]+]] = global i8 0 ;. define internal i32 @dead_internal_func(i32 %0) { ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@dead_internal_func ; CGSCC-SAME: () #[[ATTR6:[0-9]+]] { ; CGSCC-NEXT: br label [[TMP2:%.*]] ; CGSCC: 1: ; CGSCC-NEXT: ret i32 undef ; CGSCC: 2: ; CGSCC-NEXT: [[TMP3:%.*]] = phi i32 [ [[TMP6:%.*]], [[TMP2]] ], [ 1, [[TMP0:%.*]] ] ; CGSCC-NEXT: [[TMP4:%.*]] = phi i32 [ [[TMP5:%.*]], [[TMP2]] ], [ 1, [[TMP0]] ] ; CGSCC-NEXT: [[TMP5]] = mul nsw i32 [[TMP3]], [[TMP4]] ; CGSCC-NEXT: [[TMP6]] = add nuw nsw i32 [[TMP3]], 1 ; CGSCC-NEXT: [[TMP7:%.*]] = icmp eq i32 [[TMP3]], 10 ; CGSCC-NEXT: br i1 [[TMP7]], label [[TMP1:%.*]], label [[TMP2]] ; %2 = icmp slt i32 %0, 1 br i1 %2, label %3, label %5 ;