85 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals2; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,TUNIT3; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC4 5define internal i32 @testf(i1 %c) {6; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)7; CGSCC-LABEL: define {{[^@]+}}@testf8; CGSCC-SAME: (i1 noundef [[C:%.*]]) #[[ATTR0:[0-9]+]] {9; CGSCC-NEXT: entry:10; CGSCC-NEXT: br i1 [[C]], label [[IF_COND:%.*]], label [[IF_END:%.*]]11; CGSCC: if.cond:12; CGSCC-NEXT: unreachable13; CGSCC: if.then:14; CGSCC-NEXT: unreachable15; CGSCC: if.end:16; CGSCC-NEXT: ret i32 1017;18entry:19 br i1 %c, label %if.cond, label %if.end20 21if.cond:22 br i1 undef, label %if.then, label %if.end23 24if.then: ; preds = %entry, %if.then25 ret i32 1126 27if.end: ; preds = %if.then1, %entry28 ret i32 1029}30 31define internal i32 @test1(i1 %c) {32; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)33; CGSCC-LABEL: define {{[^@]+}}@test134; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR1:[0-9]+]] {35; CGSCC-NEXT: entry:36; CGSCC-NEXT: br label [[IF_THEN:%.*]]37; CGSCC: if.then:38; CGSCC-NEXT: [[CALL:%.*]] = call i32 @testf(i1 noundef [[C]]) #[[ATTR2:[0-9]+]]39; CGSCC-NEXT: [[RES:%.*]] = icmp eq i32 [[CALL]], 1040; CGSCC-NEXT: br i1 [[RES]], label [[RET1:%.*]], label [[RET2:%.*]]41; CGSCC: ret1:42; CGSCC-NEXT: ret i32 9943; CGSCC: ret2:44; CGSCC-NEXT: ret i32 045;46entry:47 br label %if.then48 49if.then: ; preds = %entry, %if.then50 %call = call i32 @testf(i1 %c)51 %res = icmp eq i32 %call, 1052 br i1 %res, label %ret1, label %ret253 54ret1: ; preds = %if.then, %entry55 ret i32 9956 57ret2: ; preds = %if.then, %entry58 ret i32 059}60 61define i32 @main(i1 %c) {62; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)63; TUNIT-LABEL: define {{[^@]+}}@main64; TUNIT-SAME: (i1 [[C:%.*]]) #[[ATTR0:[0-9]+]] {65; TUNIT-NEXT: ret i32 9966;67; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)68; CGSCC-LABEL: define {{[^@]+}}@main69; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR1]] {70; CGSCC-NEXT: [[RES:%.*]] = call noundef i32 @test1(i1 [[C]]) #[[ATTR2]]71; CGSCC-NEXT: ret i32 [[RES]]72;73 %res = call i32 @test1(i1 %c)74 ret i32 %res75}76;.77; TUNIT: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) }78;.79; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) }80; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree nosync nounwind willreturn memory(none) }81; CGSCC: attributes #[[ATTR2]] = { nofree nosync willreturn }82;.83;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:84; CHECK: {{.*}}85