Skip to content

Commit 07f057b

Browse files
committed
Revert "Fix bounds safty tests."
This reverts commit 5779f53. This was caused by ``` commit 0931eff Merge: df2e611 e2ba1b6 Author: git apple-llvm automerger <am@git-apple-llvm> Date: Wed Feb 19 09:08:54 2025 -0800 Merge commit 'e2ba1b6ffde4' from llvm.org/main into next commit e2ba1b6 Author: Nico Weber <[email protected]> Date: Wed Feb 19 11:28:52 2025 -0500 Revert "Reapply [CaptureTracking][FunctionAttrs] Add support for CaptureInfo (llvm#125880)" This reverts commit 0fab404. Seems to break LTO builds of clang on Windows, see comments on llvm#125880 ``` This fixes the following failures: ``` Clang :: BoundsSafety/CodeGen/bounds-attributed-return-O2.c Clang :: BoundsSafety/CodeGen/bounds-attributed-return-disabled-O2.c Clang :: BoundsSafety/CodeGen/compound-literal-counted_by_or_null-O2.c Clang :: BoundsSafety/CodeGen/compound-literal-ended_by-O2.c Clang :: BoundsSafety/CodeGen/compound-literal-sized_by_or_null-O2.c Clang :: BoundsSafety/CodeGen/counted-by-nested-assignments-O2.c Clang :: BoundsSafety/CodeGen/counted-by-or-null-negative-O2.c Clang :: BoundsSafety/CodeGen/ended-by-nested-assignments-O2.c Clang :: BoundsSafety/CodeGen/nested-struct-member-count-O2.c Clang :: BoundsSafety/CodeGen/trap-function-returns-O2.c ``` rdar://145309621
1 parent 8c60b78 commit 07f057b

10 files changed

+32
-32
lines changed

clang/test/BoundsSafety/CodeGen/bounds-attributed-return-O2.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ int *__counted_by(count) cb_in_from_indexable(int count, int *__indexable p) {
6666
}
6767

6868
// CHECK-LABEL: define dso_local noundef ptr @cb_in_from_single(
69-
// CHECK-SAME: i32 noundef [[COUNT:%.*]], ptr noundef readnone returned captures(ret: address, provenance) [[P:%.*]]) local_unnamed_addr #[[ATTR0]] {
69+
// CHECK-SAME: i32 noundef [[COUNT:%.*]], ptr noundef readnone returned [[P:%.*]]) local_unnamed_addr #[[ATTR0]] {
7070
// CHECK-NEXT: [[ENTRY:.*:]]
7171
// CHECK-NEXT: [[SPEC_SELECT:%.*]] = icmp ult i32 [[COUNT]], 2
7272
// CHECK-NEXT: br i1 [[SPEC_SELECT]], label %[[CONT:.*]], label %[[TRAP:.*]], !annotation [[META2]]
@@ -81,7 +81,7 @@ int *__counted_by(count) cb_in_from_single(int count, int *__single p) {
8181
}
8282

8383
// CHECK-LABEL: define dso_local noundef ptr @cb_in_from_cb(
84-
// CHECK-SAME: i32 noundef [[COUNT:%.*]], ptr noundef readnone returned captures(ret: address, provenance) [[P:%.*]]) local_unnamed_addr #[[ATTR0]] {
84+
// CHECK-SAME: i32 noundef [[COUNT:%.*]], ptr noundef readnone returned [[P:%.*]]) local_unnamed_addr #[[ATTR0]] {
8585
// CHECK-NEXT: [[ENTRY:.*:]]
8686
// CHECK-NEXT: [[CMP_NOT:%.*]] = icmp slt i32 [[COUNT]], 0, !annotation [[META2]]
8787
// CHECK-NEXT: br i1 [[CMP_NOT]], label %[[TRAP:.*]], label %[[CONT:.*]], !annotation [[META2]]
@@ -96,7 +96,7 @@ int *__counted_by(count) cb_in_from_cb(int count, int *__counted_by(count) p) {
9696
}
9797

9898
// CHECK-LABEL: define dso_local noundef ptr @cb_in_from_cb2(
99-
// CHECK-SAME: i32 noundef [[COUNT:%.*]], ptr noundef readnone returned captures(ret: address, provenance) [[P:%.*]], i32 noundef [[LEN:%.*]]) local_unnamed_addr #[[ATTR0]] {
99+
// CHECK-SAME: i32 noundef [[COUNT:%.*]], ptr noundef readnone returned [[P:%.*]], i32 noundef [[LEN:%.*]]) local_unnamed_addr #[[ATTR0]] {
100100
// CHECK-NEXT: [[ENTRY:.*:]]
101101
// CHECK-NEXT: [[IDX_EXT:%.*]] = zext i32 [[LEN]] to i64
102102
// CHECK-NEXT: [[CMP_NOT:%.*]] = icmp slt i32 [[LEN]], 0, !annotation [[META2]]
@@ -172,7 +172,7 @@ int *__counted_by(count) cb_in_from_cbn2(int count, int *__counted_by_or_null(le
172172
}
173173

174174
// CHECK-LABEL: define dso_local noundef ptr @cb_out_from_single(
175-
// CHECK-SAME: ptr noundef readonly captures(none) [[COUNT:%.*]], ptr noundef readnone returned captures(ret: address, provenance) [[P:%.*]]) local_unnamed_addr #[[ATTR0]] {
175+
// CHECK-SAME: ptr noundef readonly captures(none) [[COUNT:%.*]], ptr noundef readnone returned [[P:%.*]]) local_unnamed_addr #[[ATTR0]] {
176176
// CHECK-NEXT: [[ENTRY:.*:]]
177177
// CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[COUNT]], align 4, !tbaa [[TBAA11:![0-9]+]]
178178
// CHECK-NEXT: [[OR_COND:%.*]] = icmp ult i32 [[TMP0]], 2, !annotation [[META2]]
@@ -188,7 +188,7 @@ int *__counted_by(*count) cb_out_from_single(int *__single count, int *__single
188188
}
189189

190190
// CHECK-LABEL: define dso_local noundef ptr @cbn_in_from_single(
191-
// CHECK-SAME: i32 noundef [[COUNT:%.*]], ptr noundef readnone returned captures(address_is_null, ret: address, provenance) [[P:%.*]]) local_unnamed_addr #[[ATTR0]] {
191+
// CHECK-SAME: i32 noundef [[COUNT:%.*]], ptr noundef readnone returned [[P:%.*]]) local_unnamed_addr #[[ATTR0]] {
192192
// CHECK-NEXT: [[ENTRY:.*:]]
193193
// CHECK-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq ptr [[P]], null, !annotation [[META2]]
194194
// CHECK-NEXT: [[SPEC_SELECT:%.*]] = icmp ult i32 [[COUNT]], 2
@@ -237,7 +237,7 @@ void *__sized_by(size) sb_in_from_bidi(int size, void *__bidi_indexable p) {
237237
}
238238

239239
// CHECK-LABEL: define dso_local noundef ptr @sb_in_from_single(
240-
// CHECK-SAME: i32 noundef [[SIZE:%.*]], ptr noundef readnone returned captures(ret: address, provenance) [[P:%.*]]) local_unnamed_addr #[[ATTR0]] {
240+
// CHECK-SAME: i32 noundef [[SIZE:%.*]], ptr noundef readnone returned [[P:%.*]]) local_unnamed_addr #[[ATTR0]] {
241241
// CHECK-NEXT: [[ENTRY:.*:]]
242242
// CHECK-NEXT: [[SPEC_SELECT:%.*]] = icmp ult i32 [[SIZE]], 5
243243
// CHECK-NEXT: br i1 [[SPEC_SELECT]], label %[[CONT:.*]], label %[[TRAP:.*]], !annotation [[META2]]
@@ -252,7 +252,7 @@ void *__sized_by(size) sb_in_from_single(int size, int *__single p) {
252252
}
253253

254254
// CHECK-LABEL: define dso_local ptr @eb_in_from_bidi(
255-
// CHECK-SAME: ptr noundef readnone captures(address) [[END:%.*]], ptr noundef readonly captures(none) [[P:%.*]]) local_unnamed_addr #[[ATTR0]] {
255+
// CHECK-SAME: ptr noundef readnone [[END:%.*]], ptr noundef readonly captures(none) [[P:%.*]]) local_unnamed_addr #[[ATTR0]] {
256256
// CHECK-NEXT: [[ENTRY:.*:]]
257257
// CHECK-NEXT: [[AGG_TEMP_SROA_1_0_P_SROA_IDX:%.*]] = getelementptr inbounds nuw i8, ptr [[P]], i64 8
258258
// CHECK-NEXT: [[AGG_TEMP_SROA_1_0_COPYLOAD:%.*]] = load ptr, ptr [[AGG_TEMP_SROA_1_0_P_SROA_IDX]], align 8
@@ -278,7 +278,7 @@ void *__ended_by(end) eb_in_from_bidi(void *__single end, void *__bidi_indexable
278278
}
279279

280280
// CHECK-LABEL: define dso_local noundef ptr @eb_in_from_single(
281-
// CHECK-SAME: ptr noundef readnone captures(address) [[END:%.*]], ptr noundef readnone returned captures(address, ret: address, provenance) [[P:%.*]]) local_unnamed_addr #[[ATTR0]] {
281+
// CHECK-SAME: ptr noundef readnone [[END:%.*]], ptr noundef readnone returned [[P:%.*]]) local_unnamed_addr #[[ATTR0]] {
282282
// CHECK-NEXT: [[ENTRY:.*:]]
283283
// CHECK-NEXT: [[UPPER:%.*]] = getelementptr inbounds nuw i8, ptr [[P]], i64 4, !annotation [[META2]]
284284
// CHECK-NEXT: [[CMP:%.*]] = icmp ule ptr [[END]], [[UPPER]], !annotation [[META2]]

clang/test/BoundsSafety/CodeGen/bounds-attributed-return-disabled-O2.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ int *__counted_by(count) cb_in_from_bidi(int count, int *__bidi_indexable p) {
1717
}
1818

1919
// CHECK-LABEL: define dso_local noundef ptr @cb_in_from_single(
20-
// CHECK-SAME: i32 noundef [[COUNT:%.*]], ptr noundef readnone returned captures(ret: address, provenance) [[P:%.*]]) local_unnamed_addr #[[ATTR1:[0-9]+]] {
20+
// CHECK-SAME: i32 noundef [[COUNT:%.*]], ptr noundef readnone returned [[P:%.*]]) local_unnamed_addr #[[ATTR1:[0-9]+]] {
2121
// CHECK-NEXT: [[ENTRY:.*:]]
2222
// CHECK-NEXT: ret ptr [[P]]
2323
//
@@ -26,7 +26,7 @@ int *__counted_by(count) cb_in_from_single(int count, int *__single p) {
2626
}
2727

2828
// CHECK-LABEL: define dso_local noundef ptr @cb_out_from_single(
29-
// CHECK-SAME: ptr noundef readnone captures(none) [[COUNT:%.*]], ptr noundef readnone returned captures(ret: address, provenance) [[P:%.*]]) local_unnamed_addr #[[ATTR1]] {
29+
// CHECK-SAME: ptr noundef readnone captures(none) [[COUNT:%.*]], ptr noundef readnone returned [[P:%.*]]) local_unnamed_addr #[[ATTR1]] {
3030
// CHECK-NEXT: [[ENTRY:.*:]]
3131
// CHECK-NEXT: ret ptr [[P]]
3232
//
@@ -35,7 +35,7 @@ int *__counted_by(*count) cb_out_from_single(int *count, int *__single p) {
3535
}
3636

3737
// CHECK-LABEL: define dso_local noundef ptr @cbn_in_from_single(
38-
// CHECK-SAME: i32 noundef [[COUNT:%.*]], ptr noundef readnone returned captures(ret: address, provenance) [[P:%.*]]) local_unnamed_addr #[[ATTR1]] {
38+
// CHECK-SAME: i32 noundef [[COUNT:%.*]], ptr noundef readnone returned [[P:%.*]]) local_unnamed_addr #[[ATTR1]] {
3939
// CHECK-NEXT: [[ENTRY:.*:]]
4040
// CHECK-NEXT: ret ptr [[P]]
4141
//

clang/test/BoundsSafety/CodeGen/compound-literal-counted_by_or_null-O2.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -772,7 +772,7 @@ void assign_via_ptr_from_cbon(struct cbon* ptr, int new_count,
772772
}
773773

774774
// CHECK-LABEL: define dso_local void @assign_operator_from_cbon(
775-
// CHECK-SAME: i32 noundef [[NEW_COUNT:%.*]], ptr noundef readnone captures(address_is_null) [[NEW_PTR:%.*]]) local_unnamed_addr #[[ATTR0]] {
775+
// CHECK-SAME: i32 noundef [[NEW_COUNT:%.*]], ptr noundef readnone [[NEW_PTR:%.*]]) local_unnamed_addr #[[ATTR0]] {
776776
// CHECK-NEXT: [[ENTRY:.*:]]
777777
// CHECK-NEXT: [[DOTNOT:%.*]] = icmp ne ptr [[NEW_PTR]], null, !annotation [[META22]]
778778
// CHECK-NEXT: [[CMP_NOT48:%.*]] = icmp slt i32 [[NEW_COUNT]], 0
@@ -795,7 +795,7 @@ void assign_operator_from_cbon(int new_count,
795795

796796

797797
// CHECK-LABEL: define dso_local void @local_var_init_from_cbon(
798-
// CHECK-SAME: i32 noundef [[NEW_COUNT:%.*]], ptr noundef readnone captures(address_is_null) [[NEW_PTR:%.*]]) local_unnamed_addr #[[ATTR0]] {
798+
// CHECK-SAME: i32 noundef [[NEW_COUNT:%.*]], ptr noundef readnone [[NEW_PTR:%.*]]) local_unnamed_addr #[[ATTR0]] {
799799
// CHECK-NEXT: [[ENTRY:.*:]]
800800
// CHECK-NEXT: [[DOTNOT:%.*]] = icmp ne ptr [[NEW_PTR]], null, !annotation [[META22]]
801801
// CHECK-NEXT: [[CMP_NOT46:%.*]] = icmp slt i32 [[NEW_COUNT]], 0
@@ -867,7 +867,7 @@ struct cbon return_cbon_from_cbon(int new_count,
867867
}
868868

869869
// CHECK-LABEL: define dso_local void @construct_not_used_from_cbon(
870-
// CHECK-SAME: i32 noundef [[NEW_COUNT:%.*]], ptr noundef readnone captures(address_is_null) [[NEW_PTR:%.*]]) local_unnamed_addr #[[ATTR0]] {
870+
// CHECK-SAME: i32 noundef [[NEW_COUNT:%.*]], ptr noundef readnone [[NEW_PTR:%.*]]) local_unnamed_addr #[[ATTR0]] {
871871
// CHECK-NEXT: [[ENTRY:.*:]]
872872
// CHECK-NEXT: [[DOTNOT:%.*]] = icmp ne ptr [[NEW_PTR]], null, !annotation [[META22]]
873873
// CHECK-NEXT: [[CMP_NOT46:%.*]] = icmp slt i32 [[NEW_COUNT]], 0

clang/test/BoundsSafety/CodeGen/compound-literal-ended_by-O2.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ void assign_via_ptr(struct eb* ptr,
9191
}
9292

9393
// CHECK-LABEL: define dso_local void @assign_operator(
94-
// CHECK-SAME: ptr noundef readonly captures(none) [[NEW_START:%.*]], ptr noundef readnone captures(address) [[NEW_END:%.*]]) local_unnamed_addr #[[ATTR0]] {
94+
// CHECK-SAME: ptr noundef readonly captures(none) [[NEW_START:%.*]], ptr noundef readnone [[NEW_END:%.*]]) local_unnamed_addr #[[ATTR0]] {
9595
// CHECK-NEXT: [[ENTRY:.*:]]
9696
// CHECK-NEXT: [[AGG_TEMP_SROA_1_0_NEW_START_SROA_IDX:%.*]] = getelementptr inbounds nuw i8, ptr [[NEW_START]], i64 8
9797
// CHECK-NEXT: [[AGG_TEMP_SROA_1_0_COPYLOAD:%.*]] = load ptr, ptr [[AGG_TEMP_SROA_1_0_NEW_START_SROA_IDX]], align 8
@@ -122,7 +122,7 @@ void assign_operator(char* __bidi_indexable new_start, char* new_end) {
122122

123123

124124
// CHECK-LABEL: define dso_local void @local_var_init(
125-
// CHECK-SAME: ptr noundef readonly captures(none) [[NEW_START:%.*]], ptr noundef readnone captures(address) [[NEW_END:%.*]]) local_unnamed_addr #[[ATTR0]] {
125+
// CHECK-SAME: ptr noundef readonly captures(none) [[NEW_START:%.*]], ptr noundef readnone [[NEW_END:%.*]]) local_unnamed_addr #[[ATTR0]] {
126126
// CHECK-NEXT: [[ENTRY:.*:]]
127127
// CHECK-NEXT: [[AGG_TEMP_SROA_1_0_NEW_START_SROA_IDX:%.*]] = getelementptr inbounds nuw i8, ptr [[NEW_START]], i64 8
128128
// CHECK-NEXT: [[AGG_TEMP_SROA_1_0_COPYLOAD:%.*]] = load ptr, ptr [[AGG_TEMP_SROA_1_0_NEW_START_SROA_IDX]], align 8
@@ -218,7 +218,7 @@ struct eb return_eb(char* __bidi_indexable new_start, char* new_end) {
218218
}
219219

220220
// CHECK-LABEL: define dso_local void @construct_not_used(
221-
// CHECK-SAME: ptr noundef readonly captures(none) [[NEW_START:%.*]], ptr noundef readnone captures(address) [[NEW_END:%.*]]) local_unnamed_addr #[[ATTR0]] {
221+
// CHECK-SAME: ptr noundef readonly captures(none) [[NEW_START:%.*]], ptr noundef readnone [[NEW_END:%.*]]) local_unnamed_addr #[[ATTR0]] {
222222
// CHECK-NEXT: [[ENTRY:.*:]]
223223
// CHECK-NEXT: [[AGG_TEMP_SROA_1_0_NEW_START_SROA_IDX:%.*]] = getelementptr inbounds nuw i8, ptr [[NEW_START]], i64 8
224224
// CHECK-NEXT: [[AGG_TEMP_SROA_1_0_COPYLOAD:%.*]] = load ptr, ptr [[AGG_TEMP_SROA_1_0_NEW_START_SROA_IDX]], align 8
@@ -614,7 +614,7 @@ void assign_via_ptr_from_eb(struct eb* ptr,
614614
}
615615

616616
// CHECK-LABEL: define dso_local void @assign_operator_from_eb(
617-
// CHECK-SAME: ptr noundef readnone captures(address) [[NEW_START:%.*]], ptr noundef readnone captures(address) [[NEW_END:%.*]]) local_unnamed_addr #[[ATTR0]] {
617+
// CHECK-SAME: ptr noundef readnone [[NEW_START:%.*]], ptr noundef readnone [[NEW_END:%.*]]) local_unnamed_addr #[[ATTR0]] {
618618
// CHECK-NEXT: [[ENTRY:.*:]]
619619
// CHECK-NEXT: [[CMP19_NOT:%.*]] = icmp ugt ptr [[NEW_START]], [[NEW_END]], !annotation [[META2]]
620620
// CHECK-NEXT: br i1 [[CMP19_NOT]], label %[[TRAP:.*]], label %[[CONT:.*]], !annotation [[META2]]
@@ -634,7 +634,7 @@ void assign_operator_from_eb(char* __ended_by(new_end) new_start, char* new_end)
634634

635635

636636
// CHECK-LABEL: define dso_local void @local_var_init_from_eb(
637-
// CHECK-SAME: ptr noundef readnone captures(address) [[NEW_START:%.*]], ptr noundef readnone captures(address) [[NEW_END:%.*]]) local_unnamed_addr #[[ATTR0]] {
637+
// CHECK-SAME: ptr noundef readnone [[NEW_START:%.*]], ptr noundef readnone [[NEW_END:%.*]]) local_unnamed_addr #[[ATTR0]] {
638638
// CHECK-NEXT: [[ENTRY:.*:]]
639639
// CHECK-NEXT: [[CMP19_NOT:%.*]] = icmp ugt ptr [[NEW_START]], [[NEW_END]], !annotation [[META2]]
640640
// CHECK-NEXT: br i1 [[CMP19_NOT]], label %[[TRAP:.*]], label %[[CONT:.*]], !annotation [[META2]]
@@ -697,7 +697,7 @@ struct eb return_eb_from_eb(char* __ended_by(new_end) new_start, char* new_end)
697697
}
698698

699699
// CHECK-LABEL: define dso_local void @construct_not_used_from_eb(
700-
// CHECK-SAME: ptr noundef readnone captures(address) [[NEW_START:%.*]], ptr noundef readnone captures(address) [[NEW_END:%.*]]) local_unnamed_addr #[[ATTR0]] {
700+
// CHECK-SAME: ptr noundef readnone [[NEW_START:%.*]], ptr noundef readnone [[NEW_END:%.*]]) local_unnamed_addr #[[ATTR0]] {
701701
// CHECK-NEXT: [[ENTRY:.*:]]
702702
// CHECK-NEXT: [[CMP19_NOT:%.*]] = icmp ugt ptr [[NEW_START]], [[NEW_END]], !annotation [[META2]]
703703
// CHECK-NEXT: br i1 [[CMP19_NOT]], label %[[TRAP:.*]], label %[[CONT:.*]], !annotation [[META2]]

clang/test/BoundsSafety/CodeGen/compound-literal-sized_by_or_null-O2.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -772,7 +772,7 @@ void assign_via_ptr_from_sbon(struct sbon* ptr, int new_count,
772772
}
773773

774774
// CHECK-LABEL: define dso_local void @assign_operator_from_sbon(
775-
// CHECK-SAME: i32 noundef [[NEW_COUNT:%.*]], ptr noundef readnone captures(address_is_null) [[NEW_PTR:%.*]]) local_unnamed_addr #[[ATTR0]] {
775+
// CHECK-SAME: i32 noundef [[NEW_COUNT:%.*]], ptr noundef readnone [[NEW_PTR:%.*]]) local_unnamed_addr #[[ATTR0]] {
776776
// CHECK-NEXT: [[ENTRY:.*:]]
777777
// CHECK-NEXT: [[DOTNOT:%.*]] = icmp ne ptr [[NEW_PTR]], null, !annotation [[META22]]
778778
// CHECK-NEXT: [[CMP_NOT48:%.*]] = icmp slt i32 [[NEW_COUNT]], 0
@@ -795,7 +795,7 @@ void assign_operator_from_sbon(int new_count,
795795

796796

797797
// CHECK-LABEL: define dso_local void @local_var_init_from_sbon(
798-
// CHECK-SAME: i32 noundef [[NEW_COUNT:%.*]], ptr noundef readnone captures(address_is_null) [[NEW_PTR:%.*]]) local_unnamed_addr #[[ATTR0]] {
798+
// CHECK-SAME: i32 noundef [[NEW_COUNT:%.*]], ptr noundef readnone [[NEW_PTR:%.*]]) local_unnamed_addr #[[ATTR0]] {
799799
// CHECK-NEXT: [[ENTRY:.*:]]
800800
// CHECK-NEXT: [[DOTNOT:%.*]] = icmp ne ptr [[NEW_PTR]], null, !annotation [[META22]]
801801
// CHECK-NEXT: [[CMP_NOT46:%.*]] = icmp slt i32 [[NEW_COUNT]], 0
@@ -867,7 +867,7 @@ struct sbon return_sbon_from_sbon(int new_count,
867867
}
868868

869869
// CHECK-LABEL: define dso_local void @construct_not_used_from_sbon(
870-
// CHECK-SAME: i32 noundef [[NEW_COUNT:%.*]], ptr noundef readnone captures(address_is_null) [[NEW_PTR:%.*]]) local_unnamed_addr #[[ATTR0]] {
870+
// CHECK-SAME: i32 noundef [[NEW_COUNT:%.*]], ptr noundef readnone [[NEW_PTR:%.*]]) local_unnamed_addr #[[ATTR0]] {
871871
// CHECK-NEXT: [[ENTRY:.*:]]
872872
// CHECK-NEXT: [[DOTNOT:%.*]] = icmp ne ptr [[NEW_PTR]], null, !annotation [[META22]]
873873
// CHECK-NEXT: [[CMP_NOT46:%.*]] = icmp slt i32 [[NEW_COUNT]], 0

clang/test/BoundsSafety/CodeGen/counted-by-nested-assignments-O2.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// WITHOUT-NEXT: store i32 0, ptr [[X]], align 4, !tbaa [[TBAA2:![0-9]+]]
1313
// WITHOUT-NEXT: ret void
1414
// CHECK-LABEL: define dso_local void @foo(
15-
// CHECK-SAME: ptr noundef writeonly captures(address) [[X:%.*]], i32 noundef [[COUNT:%.*]]) local_unnamed_addr #[[ATTR0:[0-9]+]] {
15+
// CHECK-SAME: ptr noundef writeonly [[X:%.*]], i32 noundef [[COUNT:%.*]]) local_unnamed_addr #[[ATTR0:[0-9]+]] {
1616
// CHECK-NEXT: [[ENTRY:.*:]]
1717
// CHECK-NEXT: [[IDX_EXT:%.*]] = zext i32 [[COUNT]] to i64
1818
// CHECK-NEXT: [[ADD_PTR_IDX:%.*]] = shl nuw nsw i64 [[IDX_EXT]], 2, !annotation [[META2:![0-9]+]]
@@ -54,7 +54,7 @@ void foo(int *__counted_by(count) x, unsigned count) {
5454
// WITHOUT-NEXT: store i32 0, ptr [[BOUND_PTR_ARITH]], align 4, !tbaa [[TBAA2]]
5555
// WITHOUT-NEXT: ret void
5656
// CHECK-LABEL: define dso_local void @bar(
57-
// CHECK-SAME: ptr noundef writeonly captures(address) [[X:%.*]], i32 noundef [[COUNT:%.*]]) local_unnamed_addr #[[ATTR0]] {
57+
// CHECK-SAME: ptr noundef writeonly [[X:%.*]], i32 noundef [[COUNT:%.*]]) local_unnamed_addr #[[ATTR0]] {
5858
// CHECK-NEXT: [[ENTRY:.*:]]
5959
// CHECK-NEXT: [[IDX_EXT:%.*]] = sext i32 [[COUNT]] to i64
6060
// CHECK-NEXT: [[ADD_PTR_IDX:%.*]] = shl nsw i64 [[IDX_EXT]], 2, !annotation [[META5]]

clang/test/BoundsSafety/CodeGen/counted-by-or-null-negative-O2.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#include <stddef.h>
88

99
// CHECK-LABEL: define dso_local void @to_bidi(
10-
// CHECK-SAME: ptr dead_on_unwind noalias writable writeonly sret(%"__bounds_safety::wide_ptr.bidi_indexable") align 8 captures(none) [[AGG_RESULT:%.*]], ptr noundef readnone captures(address_is_null) [[ARG:%.*]]) local_unnamed_addr #[[ATTR0:[0-9]+]] {
10+
// CHECK-SAME: ptr dead_on_unwind noalias writable writeonly sret(%"__bounds_safety::wide_ptr.bidi_indexable") align 8 captures(none) [[AGG_RESULT:%.*]], ptr noundef readnone [[ARG:%.*]]) local_unnamed_addr #[[ATTR0:[0-9]+]] {
1111
// CHECK-NEXT: entry:
1212
// CHECK-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq ptr [[ARG]], null, !annotation [[META2:![0-9]+]]
1313
// CHECK-NEXT: br i1 [[TOBOOL_NOT]], label [[BOUNDSCHECK_NULL:%.*]], label [[TRAP:%.*]], !annotation [[META2]]
@@ -25,7 +25,7 @@ int *__bidi_indexable to_bidi(int * arg) {
2525
}
2626

2727
// CHECK-LABEL: define dso_local void @to_bidi_literal_count(
28-
// CHECK-SAME: ptr dead_on_unwind noalias writable writeonly sret(%"__bounds_safety::wide_ptr.bidi_indexable") align 8 captures(none) [[AGG_RESULT:%.*]], ptr noundef readnone captures(address_is_null) [[ARG:%.*]]) local_unnamed_addr #[[ATTR0]] {
28+
// CHECK-SAME: ptr dead_on_unwind noalias writable writeonly sret(%"__bounds_safety::wide_ptr.bidi_indexable") align 8 captures(none) [[AGG_RESULT:%.*]], ptr noundef readnone [[ARG:%.*]]) local_unnamed_addr #[[ATTR0]] {
2929
// CHECK-NEXT: entry:
3030
// CHECK-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq ptr [[ARG]], null, !annotation [[META2]]
3131
// CHECK-NEXT: br i1 [[TOBOOL_NOT]], label [[BOUNDSCHECK_NULL:%.*]], label [[TRAP_CRITEDGE:%.*]], !annotation [[META2]]
@@ -42,7 +42,7 @@ int *__bidi_indexable to_bidi_literal_count(int * arg) {
4242
}
4343

4444
// CHECK-LABEL: define dso_local void @to_bidi_const_count(
45-
// CHECK-SAME: ptr dead_on_unwind noalias writable writeonly sret(%"__bounds_safety::wide_ptr.bidi_indexable") align 8 captures(none) [[AGG_RESULT:%.*]], ptr noundef readnone captures(address_is_null) [[ARG:%.*]]) local_unnamed_addr #[[ATTR0]] {
45+
// CHECK-SAME: ptr dead_on_unwind noalias writable writeonly sret(%"__bounds_safety::wide_ptr.bidi_indexable") align 8 captures(none) [[AGG_RESULT:%.*]], ptr noundef readnone [[ARG:%.*]]) local_unnamed_addr #[[ATTR0]] {
4646
// CHECK-NEXT: entry:
4747
// CHECK-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq ptr [[ARG]], null, !annotation [[META2]]
4848
// CHECK-NEXT: br i1 [[TOBOOL_NOT]], label [[BOUNDSCHECK_NULL:%.*]], label [[TRAP_CRITEDGE:%.*]], !annotation [[META2]]

clang/test/BoundsSafety/CodeGen/ended-by-nested-assignments-O2.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// WITHOUT-NEXT: store i32 0, ptr [[START]], align 4, !tbaa [[TBAA2]]
1414
// WITHOUT-NEXT: ret void
1515
// CHECK-LABEL: define dso_local void @foo(
16-
// CHECK-SAME: ptr noundef writeonly captures(address) [[START:%.*]], ptr noundef writeonly captures(address) [[END:%.*]]) local_unnamed_addr #[[ATTR0:[0-9]+]] {
16+
// CHECK-SAME: ptr noundef writeonly [[START:%.*]], ptr noundef writeonly [[END:%.*]]) local_unnamed_addr #[[ATTR0:[0-9]+]] {
1717
// CHECK-NEXT: [[ENTRY:.*:]]
1818
// CHECK-NEXT: [[BOUND_PTR_ARITH:%.*]] = getelementptr i8, ptr [[END]], i64 -4
1919
// CHECK-NEXT: [[BOUND_PTR_ARITH3:%.*]] = getelementptr i8, ptr [[START]], i64 4
@@ -46,7 +46,7 @@ void foo(int *__ended_by(end) start, int * end) {
4646
// WITHOUT-NEXT: store i32 0, ptr [[BOUND_PTR_ARITH3]], align 4, !tbaa [[TBAA2]]
4747
// WITHOUT-NEXT: ret void
4848
// CHECK-LABEL: define dso_local void @bar(
49-
// CHECK-SAME: ptr noundef writeonly captures(address) [[START:%.*]], ptr noundef writeonly captures(address) [[END:%.*]]) local_unnamed_addr #[[ATTR0]] {
49+
// CHECK-SAME: ptr noundef writeonly [[START:%.*]], ptr noundef writeonly [[END:%.*]]) local_unnamed_addr #[[ATTR0]] {
5050
// CHECK-NEXT: [[ENTRY:.*:]]
5151
// CHECK-NEXT: [[BOUND_PTR_ARITH:%.*]] = getelementptr i8, ptr [[START]], i64 4
5252
// CHECK-NEXT: [[BOUND_PTR_ARITH3:%.*]] = getelementptr i8, ptr [[END]], i64 -4

clang/test/BoundsSafety/CodeGen/nested-struct-member-count-O2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ struct Outer {
1616
};
1717

1818
// CHECK-LABEL: define dso_local i8 @access(
19-
// CHECK-SAME: ptr noundef readonly captures(address) [[BAR:%.*]], i32 noundef [[INDEX:%.*]]) local_unnamed_addr #[[ATTR0:[0-9]+]] {
19+
// CHECK-SAME: ptr noundef readonly [[BAR:%.*]], i32 noundef [[INDEX:%.*]]) local_unnamed_addr #[[ATTR0:[0-9]+]] {
2020
// CHECK-NEXT: entry:
2121
// CHECK-NEXT: [[FAM:%.*]] = getelementptr inbounds nuw i8, ptr [[BAR]], i64 8
2222
// CHECK-NEXT: [[LEN:%.*]] = getelementptr inbounds nuw i8, ptr [[BAR]], i64 4

0 commit comments

Comments
 (0)