44
55;; This function returns its second argument on all return statements
66define internal ptr @incdec (i1 %C , ptr %V ) {
7- ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write)
7+ ; TUNIT: Function Attrs: mustprogress nofree norecurse nounwind willreturn
88; TUNIT-LABEL: define {{[^@]+}}@incdec
9- ; TUNIT-SAME: (i1 noundef [[C:%.*]], ptr noalias nofree noundef nonnull returned writeonly align 4 dereferenceable(4) "no-capture-maybe-returned" [[V:%.*]]) #[[ATTR0:[0-9]+]] {
9+ ; TUNIT-SAME: (i1 noundef [[C:%.*]], ptr nofree noundef nonnull returned align 4 dereferenceable(4) [[V:%.*]]) #[[ATTR0:[0-9]+]] {
10+ ; TUNIT-NEXT: [[X:%.*]] = load i32, ptr [[V]], align 4
1011; TUNIT-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]]
1112; TUNIT: T:
13+ ; TUNIT-NEXT: [[X1:%.*]] = add i32 [[X]], 1
14+ ; TUNIT-NEXT: store i32 [[X1]], ptr [[V]], align 4
1215; TUNIT-NEXT: ret ptr [[V]]
1316; TUNIT: F:
17+ ; TUNIT-NEXT: [[X2:%.*]] = sub i32 [[X]], 1
18+ ; TUNIT-NEXT: store i32 [[X2]], ptr [[V]], align 4
1419; TUNIT-NEXT: ret ptr [[V]]
1520;
1621; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite)
@@ -44,13 +49,13 @@ F: ; preds = %0
4449;; This function returns its first argument as a part of a multiple return
4550;; value
4651define internal { i32 , i32 } @foo (i32 %A , i32 %B ) {
47- ; CGSCC : Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)
48- ; CGSCC -LABEL: define {{[^@]+}}@foo
49- ; CGSCC -SAME: (i32 noundef [[A:%.*]], i32 noundef [[B:%.*]]) #[[ATTR1:[0-9]+]] {
50- ; CGSCC -NEXT: [[X:%.*]] = add i32 [[A]], [[B]]
51- ; CGSCC -NEXT: [[Y:%.*]] = insertvalue { i32, i32 } undef, i32 [[A]], 0
52- ; CGSCC -NEXT: [[Z:%.*]] = insertvalue { i32, i32 } [[Y]], i32 [[X]], 1
53- ; CGSCC -NEXT: ret { i32, i32 } [[Z]]
52+ ; CHECK : Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)
53+ ; CHECK -LABEL: define {{[^@]+}}@foo
54+ ; CHECK -SAME: (i32 noundef [[A:%.*]], i32 noundef [[B:%.*]]) #[[ATTR1:[0-9]+]] {
55+ ; CHECK -NEXT: [[X:%.*]] = add i32 [[A]], [[B]]
56+ ; CHECK -NEXT: [[Y:%.*]] = insertvalue { i32, i32 } undef, i32 [[A]], 0
57+ ; CHECK -NEXT: [[Z:%.*]] = insertvalue { i32, i32 } [[Y]], i32 [[X]], 1
58+ ; CHECK -NEXT: ret { i32, i32 } [[Z]]
5459;
5560 %X = add i32 %A , %B
5661 %Y = insertvalue { i32 , i32 } undef , i32 %A , 0
@@ -59,13 +64,19 @@ define internal { i32, i32 } @foo(i32 %A, i32 %B) {
5964}
6065
6166define void @caller (i1 %C ) personality ptr @__gxx_personality_v0 {
62- ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)
67+ ; TUNIT: Function Attrs: norecurse
6368; TUNIT-LABEL: define {{[^@]+}}@caller
64- ; TUNIT-SAME: (i1 [[C:%.*]]) #[[ATTR1 :[0-9]+]] personality ptr @__gxx_personality_v0 {
69+ ; TUNIT-SAME: (i1 [[C:%.*]]) #[[ATTR2 :[0-9]+]] personality ptr @__gxx_personality_v0 {
6570; TUNIT-NEXT: [[Q:%.*]] = alloca i32, align 4
66- ; TUNIT-NEXT: [[W:%.*]] = call align 4 ptr @incdec(i1 noundef [[C]], ptr noalias nofree noundef nonnull writeonly align 4 dereferenceable(4) "no-capture-maybe-returned" [[Q]]) #[[ATTR2:[0-9]+]]
71+ ; TUNIT-NEXT: [[W:%.*]] = call align 4 ptr @incdec(i1 noundef [[C]], ptr nofree noundef nonnull align 4 dereferenceable(4) [[Q]]) #[[ATTR3:[0-9]+]]
72+ ; TUNIT-NEXT: [[S1:%.*]] = call { i32, i32 } @foo(i32 noundef 1, i32 noundef 2) #[[ATTR4:[0-9]+]]
73+ ; TUNIT-NEXT: [[X1:%.*]] = extractvalue { i32, i32 } [[S1]], 0
74+ ; TUNIT-NEXT: [[S2:%.*]] = call { i32, i32 } @foo(i32 noundef 3, i32 noundef 4) #[[ATTR4]]
6775; TUNIT-NEXT: br label [[OK:%.*]]
6876; TUNIT: OK:
77+ ; TUNIT-NEXT: [[X2:%.*]] = extractvalue { i32, i32 } [[S2]], 0
78+ ; TUNIT-NEXT: [[Z:%.*]] = add i32 [[X1]], [[X2]]
79+ ; TUNIT-NEXT: store i32 [[Z]], ptr [[Q]], align 4
6980; TUNIT-NEXT: br label [[RET:%.*]]
7081; TUNIT: LPAD:
7182; TUNIT-NEXT: unreachable
@@ -118,9 +129,11 @@ RET:
118129
119130declare i32 @__gxx_personality_v0 (...)
120131;.
121- ; TUNIT: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) }
132+ ; TUNIT: attributes #[[ATTR0]] = { mustprogress nofree norecurse nounwind willreturn }
122133; TUNIT: attributes #[[ATTR1]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) }
123- ; TUNIT: attributes #[[ATTR2]] = { nofree nosync nounwind willreturn memory(write) }
134+ ; TUNIT: attributes #[[ATTR2]] = { norecurse }
135+ ; TUNIT: attributes #[[ATTR3]] = { nofree nounwind willreturn }
136+ ; TUNIT: attributes #[[ATTR4]] = { nounwind memory(none) }
124137;.
125138; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) }
126139; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) }
@@ -129,5 +142,3 @@ declare i32 @__gxx_personality_v0(...)
129142; CGSCC: attributes #[[ATTR4]] = { nofree nosync willreturn }
130143; CGSCC: attributes #[[ATTR5]] = { nofree nosync nounwind willreturn memory(none) }
131144;.
132- ;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
133- ; CHECK: {{.*}}
0 commit comments