Skip to content

Commit 6810a7c

Browse files
hnrklssnjroelofs
authored andcommitted
[BoundsSafety] Update CodeGen test failures with dead_on_return (NFC)
rdar://156406250
1 parent 923cd49 commit 6810a7c

File tree

44 files changed

+830
-839
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+830
-839
lines changed

clang/test/BoundsSafety/CodeGen/access-size-check-elt-size.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88

99
// NEW-LABEL: define dso_local i8 @access_uint8(
10-
// NEW-SAME: ptr noundef [[PTR:%.*]], i32 noundef [[IDX:%.*]]) #[[ATTR0:[0-9]+]] {
10+
// NEW-SAME: ptr dead_on_return noundef [[PTR:%.*]], i32 noundef [[IDX:%.*]]) #[[ATTR0:[0-9]+]] {
1111
// NEW-NEXT: [[ENTRY:.*:]]
1212
// NEW-NEXT: [[PTR_INDIRECT_ADDR:%.*]] = alloca ptr, align 8
1313
// NEW-NEXT: [[IDX_ADDR:%.*]] = alloca i32, align 4
@@ -40,7 +40,7 @@
4040
// NEW-NEXT: ret i8 [[TMP3]]
4141
//
4242
// LEGACY-LABEL: define dso_local i8 @access_uint8(
43-
// LEGACY-SAME: ptr noundef [[PTR:%.*]], i32 noundef [[IDX:%.*]]) #[[ATTR0:[0-9]+]] {
43+
// LEGACY-SAME: ptr dead_on_return noundef [[PTR:%.*]], i32 noundef [[IDX:%.*]]) #[[ATTR0:[0-9]+]] {
4444
// LEGACY-NEXT: [[ENTRY:.*:]]
4545
// LEGACY-NEXT: [[PTR_INDIRECT_ADDR:%.*]] = alloca ptr, align 8
4646
// LEGACY-NEXT: [[IDX_ADDR:%.*]] = alloca i32, align 4
@@ -77,7 +77,7 @@ uint8_t access_uint8(uint8_t* __bidi_indexable ptr, int idx) {
7777
}
7878

7979
// NEW-LABEL: define dso_local i16 @access_uint16(
80-
// NEW-SAME: ptr noundef [[PTR:%.*]], i32 noundef [[IDX:%.*]]) #[[ATTR0]] {
80+
// NEW-SAME: ptr dead_on_return noundef [[PTR:%.*]], i32 noundef [[IDX:%.*]]) #[[ATTR0]] {
8181
// NEW-NEXT: [[ENTRY:.*:]]
8282
// NEW-NEXT: [[PTR_INDIRECT_ADDR:%.*]] = alloca ptr, align 8
8383
// NEW-NEXT: [[IDX_ADDR:%.*]] = alloca i32, align 4
@@ -117,7 +117,7 @@ uint8_t access_uint8(uint8_t* __bidi_indexable ptr, int idx) {
117117
// NEW-NEXT: ret i16 [[TMP5]]
118118
//
119119
// LEGACY-LABEL: define dso_local i16 @access_uint16(
120-
// LEGACY-SAME: ptr noundef [[PTR:%.*]], i32 noundef [[IDX:%.*]]) #[[ATTR0]] {
120+
// LEGACY-SAME: ptr dead_on_return noundef [[PTR:%.*]], i32 noundef [[IDX:%.*]]) #[[ATTR0]] {
121121
// LEGACY-NEXT: [[ENTRY:.*:]]
122122
// LEGACY-NEXT: [[PTR_INDIRECT_ADDR:%.*]] = alloca ptr, align 8
123123
// LEGACY-NEXT: [[IDX_ADDR:%.*]] = alloca i32, align 4
@@ -154,7 +154,7 @@ uint16_t access_uint16(uint16_t* __bidi_indexable ptr, int idx) {
154154
}
155155

156156
// NEW-LABEL: define dso_local i32 @access_uint32(
157-
// NEW-SAME: ptr noundef [[PTR:%.*]], i32 noundef [[IDX:%.*]]) #[[ATTR0]] {
157+
// NEW-SAME: ptr dead_on_return noundef [[PTR:%.*]], i32 noundef [[IDX:%.*]]) #[[ATTR0]] {
158158
// NEW-NEXT: [[ENTRY:.*:]]
159159
// NEW-NEXT: [[PTR_INDIRECT_ADDR:%.*]] = alloca ptr, align 8
160160
// NEW-NEXT: [[IDX_ADDR:%.*]] = alloca i32, align 4
@@ -194,7 +194,7 @@ uint16_t access_uint16(uint16_t* __bidi_indexable ptr, int idx) {
194194
// NEW-NEXT: ret i32 [[TMP5]]
195195
//
196196
// LEGACY-LABEL: define dso_local i32 @access_uint32(
197-
// LEGACY-SAME: ptr noundef [[PTR:%.*]], i32 noundef [[IDX:%.*]]) #[[ATTR0]] {
197+
// LEGACY-SAME: ptr dead_on_return noundef [[PTR:%.*]], i32 noundef [[IDX:%.*]]) #[[ATTR0]] {
198198
// LEGACY-NEXT: [[ENTRY:.*:]]
199199
// LEGACY-NEXT: [[PTR_INDIRECT_ADDR:%.*]] = alloca ptr, align 8
200200
// LEGACY-NEXT: [[IDX_ADDR:%.*]] = alloca i32, align 4
@@ -231,7 +231,7 @@ uint32_t access_uint32(uint32_t* __bidi_indexable ptr, int idx) {
231231
}
232232

233233
// NEW-LABEL: define dso_local i64 @access_uint64(
234-
// NEW-SAME: ptr noundef [[PTR:%.*]], i32 noundef [[IDX:%.*]]) #[[ATTR0]] {
234+
// NEW-SAME: ptr dead_on_return noundef [[PTR:%.*]], i32 noundef [[IDX:%.*]]) #[[ATTR0]] {
235235
// NEW-NEXT: [[ENTRY:.*:]]
236236
// NEW-NEXT: [[PTR_INDIRECT_ADDR:%.*]] = alloca ptr, align 8
237237
// NEW-NEXT: [[IDX_ADDR:%.*]] = alloca i32, align 4
@@ -271,7 +271,7 @@ uint32_t access_uint32(uint32_t* __bidi_indexable ptr, int idx) {
271271
// NEW-NEXT: ret i64 [[TMP5]]
272272
//
273273
// LEGACY-LABEL: define dso_local i64 @access_uint64(
274-
// LEGACY-SAME: ptr noundef [[PTR:%.*]], i32 noundef [[IDX:%.*]]) #[[ATTR0]] {
274+
// LEGACY-SAME: ptr dead_on_return noundef [[PTR:%.*]], i32 noundef [[IDX:%.*]]) #[[ATTR0]] {
275275
// LEGACY-NEXT: [[ENTRY:.*:]]
276276
// LEGACY-NEXT: [[PTR_INDIRECT_ADDR:%.*]] = alloca ptr, align 8
277277
// LEGACY-NEXT: [[IDX_ADDR:%.*]] = alloca i32, align 4

clang/test/BoundsSafety/CodeGen/array_subscript_agg.c

Lines changed: 51 additions & 51 deletions
Large diffs are not rendered by default.

clang/test/BoundsSafety/CodeGen/bounds-attributed-in-return-null-system-header-O0.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ void consume(int* __bidi_indexable);
2929
// CHECK-NEXT: [[TMP3:%.*]] = getelementptr inbounds nuw %"__bounds_safety::wide_ptr.bidi_indexable", ptr [[PTR]], i32 0, i32 2
3030
// CHECK-NEXT: store ptr [[CALL]], ptr [[TMP3]], align 8
3131
// CHECK-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 8 [[BYVAL_TEMP]], ptr align 8 [[PTR]], i64 24, i1 false)
32-
// CHECK-NEXT: call void @consume(ptr noundef [[BYVAL_TEMP]])
32+
// CHECK-NEXT: call void @consume(ptr dead_on_return noundef [[BYVAL_TEMP]])
3333
// CHECK-NEXT: ret void
3434
//
3535
// LEGACY-LABEL: define dso_local void @use_inline_header_func_unspecified_ptr(
@@ -50,7 +50,7 @@ void consume(int* __bidi_indexable);
5050
// LEGACY-NEXT: [[TMP3:%.*]] = getelementptr inbounds nuw %"__bounds_safety::wide_ptr.bidi_indexable", ptr [[PTR]], i32 0, i32 2
5151
// LEGACY-NEXT: store ptr [[CALL]], ptr [[TMP3]], align 8
5252
// LEGACY-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 8 [[BYVAL_TEMP]], ptr align 8 [[PTR]], i64 24, i1 false)
53-
// LEGACY-NEXT: call void @consume(ptr noundef [[BYVAL_TEMP]])
53+
// LEGACY-NEXT: call void @consume(ptr dead_on_return noundef [[BYVAL_TEMP]])
5454
// LEGACY-NEXT: ret void
5555
//
5656
void use_inline_header_func_unspecified_ptr(int count) {
@@ -76,7 +76,7 @@ void use_inline_header_func_unspecified_ptr(int count) {
7676
// CHECK-NEXT: [[TMP3:%.*]] = getelementptr inbounds nuw %"__bounds_safety::wide_ptr.bidi_indexable", ptr [[PTR]], i32 0, i32 2
7777
// CHECK-NEXT: store ptr [[CALL]], ptr [[TMP3]], align 8
7878
// CHECK-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 8 [[BYVAL_TEMP]], ptr align 8 [[PTR]], i64 24, i1 false)
79-
// CHECK-NEXT: call void @consume(ptr noundef [[BYVAL_TEMP]])
79+
// CHECK-NEXT: call void @consume(ptr dead_on_return noundef [[BYVAL_TEMP]])
8080
// CHECK-NEXT: ret void
8181
//
8282
// LEGACY-LABEL: define dso_local void @use_inline_header_func_unsafe_indexable_ptr(
@@ -97,7 +97,7 @@ void use_inline_header_func_unspecified_ptr(int count) {
9797
// LEGACY-NEXT: [[TMP3:%.*]] = getelementptr inbounds nuw %"__bounds_safety::wide_ptr.bidi_indexable", ptr [[PTR]], i32 0, i32 2
9898
// LEGACY-NEXT: store ptr [[CALL]], ptr [[TMP3]], align 8
9999
// LEGACY-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 8 [[BYVAL_TEMP]], ptr align 8 [[PTR]], i64 24, i1 false)
100-
// LEGACY-NEXT: call void @consume(ptr noundef [[BYVAL_TEMP]])
100+
// LEGACY-NEXT: call void @consume(ptr dead_on_return noundef [[BYVAL_TEMP]])
101101
// LEGACY-NEXT: ret void
102102
//
103103
void use_inline_header_func_unsafe_indexable_ptr(int count) {

clang/test/BoundsSafety/CodeGen/bounds-attributed-in-return-null-system-header-O2.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ void consume(int* __bidi_indexable);
1717
// CHECK: [[INLINE_HEADER_FUNC_UNSPECIFIED_PTR_EXIT]]:
1818
// CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 24, ptr nonnull [[BYVAL_TEMP]]) #[[ATTR6:[0-9]+]]
1919
// CHECK-NEXT: call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) [[BYVAL_TEMP]], i8 0, i64 24, i1 false)
20-
// CHECK-NEXT: call void @consume(ptr noundef nonnull [[BYVAL_TEMP]]) #[[ATTR6]]
20+
// CHECK-NEXT: call void @consume(ptr dead_on_return noundef nonnull [[BYVAL_TEMP]]) #[[ATTR6]]
2121
// CHECK-NEXT: call void @llvm.lifetime.end.p0(i64 24, ptr nonnull [[BYVAL_TEMP]]) #[[ATTR6]]
2222
// CHECK-NEXT: ret void
2323
//
@@ -33,7 +33,7 @@ void consume(int* __bidi_indexable);
3333
// LEGACY-NEXT: store ptr [[ADD_PTR]], ptr [[PTR_SROA_4_0_BYVAL_TEMP_SROA_IDX]], align 8
3434
// LEGACY-NEXT: [[PTR_SROA_5_0_BYVAL_TEMP_SROA_IDX:%.*]] = getelementptr inbounds nuw i8, ptr [[BYVAL_TEMP]], i64 16
3535
// LEGACY-NEXT: store ptr null, ptr [[PTR_SROA_5_0_BYVAL_TEMP_SROA_IDX]], align 8, !tbaa [[TBAA2:![0-9]+]]
36-
// LEGACY-NEXT: call void @consume(ptr noundef nonnull [[BYVAL_TEMP]]) #[[ATTR3]]
36+
// LEGACY-NEXT: call void @consume(ptr dead_on_return noundef nonnull [[BYVAL_TEMP]]) #[[ATTR3]]
3737
// LEGACY-NEXT: call void @llvm.lifetime.end.p0(i64 24, ptr nonnull [[BYVAL_TEMP]]) #[[ATTR3]]
3838
// LEGACY-NEXT: ret void
3939
//
@@ -54,7 +54,7 @@ void use_inline_header_func_unspecified_ptr(int count) {
5454
// CHECK: [[INLINE_HEADER_FUNC_UNSAFE_INDEXABLE_PTR_EXIT]]:
5555
// CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 24, ptr nonnull [[BYVAL_TEMP]]) #[[ATTR6]]
5656
// CHECK-NEXT: call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) [[BYVAL_TEMP]], i8 0, i64 24, i1 false)
57-
// CHECK-NEXT: call void @consume(ptr noundef nonnull [[BYVAL_TEMP]]) #[[ATTR6]]
57+
// CHECK-NEXT: call void @consume(ptr dead_on_return noundef nonnull [[BYVAL_TEMP]]) #[[ATTR6]]
5858
// CHECK-NEXT: call void @llvm.lifetime.end.p0(i64 24, ptr nonnull [[BYVAL_TEMP]]) #[[ATTR6]]
5959
// CHECK-NEXT: ret void
6060
//
@@ -70,7 +70,7 @@ void use_inline_header_func_unspecified_ptr(int count) {
7070
// LEGACY-NEXT: store ptr [[ADD_PTR]], ptr [[PTR_SROA_4_0_BYVAL_TEMP_SROA_IDX]], align 8
7171
// LEGACY-NEXT: [[PTR_SROA_5_0_BYVAL_TEMP_SROA_IDX:%.*]] = getelementptr inbounds nuw i8, ptr [[BYVAL_TEMP]], i64 16
7272
// LEGACY-NEXT: store ptr null, ptr [[PTR_SROA_5_0_BYVAL_TEMP_SROA_IDX]], align 8, !tbaa [[TBAA2]]
73-
// LEGACY-NEXT: call void @consume(ptr noundef nonnull [[BYVAL_TEMP]]) #[[ATTR3]]
73+
// LEGACY-NEXT: call void @consume(ptr dead_on_return noundef nonnull [[BYVAL_TEMP]]) #[[ATTR3]]
7474
// LEGACY-NEXT: call void @llvm.lifetime.end.p0(i64 24, ptr nonnull [[BYVAL_TEMP]]) #[[ATTR3]]
7575
// LEGACY-NEXT: ret void
7676
//

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

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#include <ptrcheck.h>
66

77
// CHECK-LABEL: define dso_local ptr @cb_in_from_bidi(
8-
// CHECK-SAME: i32 noundef [[COUNT:%.*]], ptr noundef [[P:%.*]]) #[[ATTR0:[0-9]+]] {
8+
// CHECK-SAME: i32 noundef [[COUNT:%.*]], ptr dead_on_return noundef [[P:%.*]]) #[[ATTR0:[0-9]+]] {
99
// CHECK-NEXT: [[ENTRY:.*]]:
1010
// CHECK-NEXT: [[COUNT_ADDR:%.*]] = alloca i32, align 4
1111
// CHECK-NEXT: [[P_INDIRECT_ADDR:%.*]] = alloca ptr, align 8
@@ -92,7 +92,7 @@ int *__counted_by(count) cb_in_from_bidi(int count, int *__bidi_indexable p) {
9292

9393
int *__counted_by(*count) cb_in_from_bidi_redecl(int *count, int *__bidi_indexable p);
9494
// CHECK-LABEL: define dso_local ptr @cb_in_from_bidi_redecl(
95-
// CHECK-SAME: ptr noundef [[COUNT:%.*]], ptr noundef [[P:%.*]]) #[[ATTR0]] {
95+
// CHECK-SAME: ptr noundef [[COUNT:%.*]], ptr dead_on_return noundef [[P:%.*]]) #[[ATTR0]] {
9696
// CHECK-NEXT: [[ENTRY:.*]]:
9797
// CHECK-NEXT: [[COUNT_ADDR:%.*]] = alloca ptr, align 8
9898
// CHECK-NEXT: [[P_INDIRECT_ADDR:%.*]] = alloca ptr, align 8
@@ -183,9 +183,8 @@ int *__counted_by(*count) cb_in_from_bidi_redecl(int *count, int *__bidi_indexab
183183
int *__counted_by(*count) cb_in_from_bidi_typeof(int *count, int *__bidi_indexable p);
184184
__typeof__(cb_in_from_bidi_typeof) cb_in_from_bidi_typeof;
185185
extern __attribute__((weak_import)) __typeof__(cb_in_from_bidi_typeof) cb_in_from_bidi_typeof;
186-
187186
// CHECK-LABEL: define dso_local ptr @cb_in_from_bidi_typeof(
188-
// CHECK-SAME: ptr noundef [[COUNT:%.*]], ptr noundef [[P:%.*]]) #[[ATTR0]] {
187+
// CHECK-SAME: ptr noundef [[COUNT:%.*]], ptr dead_on_return noundef [[P:%.*]]) #[[ATTR0]] {
189188
// CHECK-NEXT: [[ENTRY:.*]]:
190189
// CHECK-NEXT: [[COUNT_ADDR:%.*]] = alloca ptr, align 8
191190
// CHECK-NEXT: [[P_INDIRECT_ADDR:%.*]] = alloca ptr, align 8
@@ -492,7 +491,7 @@ int *__counted_by_or_null(count) cbn_in_from_single(int count, int *__single p)
492491
}
493492

494493
// CHECK-LABEL: define dso_local ptr @sb_in_from_bidi(
495-
// CHECK-SAME: i32 noundef [[SIZE:%.*]], ptr noundef [[P:%.*]]) #[[ATTR0]] {
494+
// CHECK-SAME: i32 noundef [[SIZE:%.*]], ptr dead_on_return noundef [[P:%.*]]) #[[ATTR0]] {
496495
// CHECK-NEXT: [[ENTRY:.*]]:
497496
// CHECK-NEXT: [[SIZE_ADDR:%.*]] = alloca i32, align 4
498497
// CHECK-NEXT: [[P_INDIRECT_ADDR:%.*]] = alloca ptr, align 8
@@ -588,7 +587,7 @@ void *__sized_by(size) sb_in_from_bidi(int size, void *__bidi_indexable p) {
588587
}
589588

590589
// CHECK-LABEL: define dso_local ptr @eb_from_bidi(
591-
// CHECK-SAME: ptr noundef [[END:%.*]], ptr noundef [[P:%.*]]) #[[ATTR0]] {
590+
// CHECK-SAME: ptr noundef [[END:%.*]], ptr dead_on_return noundef [[P:%.*]]) #[[ATTR0]] {
592591
// CHECK-NEXT: [[ENTRY:.*]]:
593592
// CHECK-NEXT: [[END_ADDR:%.*]] = alloca ptr, align 8
594593
// CHECK-NEXT: [[P_INDIRECT_ADDR:%.*]] = alloca ptr, align 8

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

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

99
// CHECK-LABEL: define dso_local ptr @cb_in_from_bidi(
10-
// CHECK-SAME: i32 noundef [[COUNT:%.*]], ptr noundef readonly captures(none) [[P:%.*]]) local_unnamed_addr #[[ATTR0:[0-9]+]] {
10+
// CHECK-SAME: i32 noundef [[COUNT:%.*]], ptr dead_on_return noundef readonly captures(none) [[P:%.*]]) local_unnamed_addr #[[ATTR0:[0-9]+]] {
1111
// CHECK-NEXT: [[ENTRY:.*:]]
1212
// CHECK-NEXT: [[AGG_TEMP_SROA_0_0_COPYLOAD:%.*]] = load ptr, ptr [[P]], align 8
1313
// CHECK-NEXT: [[AGG_TEMP_SROA_2_0_P_SROA_IDX:%.*]] = getelementptr inbounds nuw i8, ptr [[P]], i64 8
@@ -203,7 +203,7 @@ int *__counted_by_or_null(count) cbn_in_from_single(int count, int *__single p)
203203
}
204204

205205
// CHECK-LABEL: define dso_local ptr @sb_in_from_bidi(
206-
// CHECK-SAME: i32 noundef [[SIZE:%.*]], ptr noundef readonly captures(none) [[P:%.*]]) local_unnamed_addr #[[ATTR0]] {
206+
// CHECK-SAME: i32 noundef [[SIZE:%.*]], ptr dead_on_return noundef readonly captures(none) [[P:%.*]]) local_unnamed_addr #[[ATTR0]] {
207207
// CHECK-NEXT: [[ENTRY:.*:]]
208208
// CHECK-NEXT: [[AGG_TEMP_SROA_0_0_COPYLOAD:%.*]] = load ptr, ptr [[P]], align 8
209209
// CHECK-NEXT: [[AGG_TEMP_SROA_2_0_P_SROA_IDX:%.*]] = getelementptr inbounds nuw i8, ptr [[P]], i64 8
@@ -250,7 +250,7 @@ void *__sized_by(size) sb_in_from_single(int size, int *__single p) {
250250
}
251251

252252
// CHECK-LABEL: define dso_local ptr @eb_in_from_bidi(
253-
// CHECK-SAME: ptr noundef readnone captures(address) [[END:%.*]], ptr noundef readonly captures(none) [[P:%.*]]) local_unnamed_addr #[[ATTR0]] {
253+
// CHECK-SAME: ptr noundef readnone captures(address) [[END:%.*]], ptr dead_on_return noundef readonly captures(none) [[P:%.*]]) local_unnamed_addr #[[ATTR0]] {
254254
// CHECK-NEXT: [[ENTRY:.*:]]
255255
// CHECK-NEXT: [[AGG_TEMP_SROA_1_0_P_SROA_IDX:%.*]] = getelementptr inbounds nuw i8, ptr [[P]], i64 8
256256
// CHECK-NEXT: [[AGG_TEMP_SROA_1_0_COPYLOAD:%.*]] = load ptr, ptr [[AGG_TEMP_SROA_1_0_P_SROA_IDX]], align 8

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

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

99
// CHECK-LABEL: define dso_local ptr @cb_in_from_bidi(
10-
// CHECK-SAME: i32 noundef [[COUNT:%.*]], ptr noundef [[P:%.*]]) #[[ATTR0:[0-9]+]] {
10+
// CHECK-SAME: i32 noundef [[COUNT:%.*]], ptr dead_on_return noundef [[P:%.*]]) #[[ATTR0:[0-9]+]] {
1111
// CHECK-NEXT: [[ENTRY:.*:]]
1212
// CHECK-NEXT: [[COUNT_ADDR:%.*]] = alloca i32, align 4
1313
// CHECK-NEXT: [[P_INDIRECT_ADDR:%.*]] = alloca ptr, align 8
@@ -70,7 +70,7 @@ int *__counted_by_or_null(count) cbn_in_from_single(int count, int *__single p)
7070
}
7171

7272
// CHECK-LABEL: define dso_local ptr @sb_in_from_bidi(
73-
// CHECK-SAME: i32 noundef [[SIZE:%.*]], ptr noundef [[P:%.*]]) #[[ATTR0]] {
73+
// CHECK-SAME: i32 noundef [[SIZE:%.*]], ptr dead_on_return noundef [[P:%.*]]) #[[ATTR0]] {
7474
// CHECK-NEXT: [[ENTRY:.*:]]
7575
// CHECK-NEXT: [[SIZE_ADDR:%.*]] = alloca i32, align 4
7676
// CHECK-NEXT: [[P_INDIRECT_ADDR:%.*]] = alloca ptr, align 8
@@ -91,7 +91,7 @@ void *__sized_by(size) sb_in_from_bidi(int size, void *__bidi_indexable p) {
9191
}
9292

9393
// CHECK-LABEL: define dso_local ptr @eb_from_bidi(
94-
// CHECK-SAME: ptr noundef [[END:%.*]], ptr noundef [[P:%.*]]) #[[ATTR0]] {
94+
// CHECK-SAME: ptr noundef [[END:%.*]], ptr dead_on_return noundef [[P:%.*]]) #[[ATTR0]] {
9595
// CHECK-NEXT: [[ENTRY:.*:]]
9696
// CHECK-NEXT: [[END_ADDR:%.*]] = alloca ptr, align 8
9797
// CHECK-NEXT: [[P_INDIRECT_ADDR:%.*]] = alloca ptr, align 8

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

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

99
// CHECK-LABEL: define dso_local ptr @cb_in_from_bidi(
10-
// CHECK-SAME: i32 noundef [[COUNT:%.*]], ptr noundef readonly captures(none) [[P:%.*]]) local_unnamed_addr #[[ATTR0:[0-9]+]] {
10+
// CHECK-SAME: i32 noundef [[COUNT:%.*]], ptr dead_on_return noundef readonly captures(none) [[P:%.*]]) local_unnamed_addr #[[ATTR0:[0-9]+]] {
1111
// CHECK-NEXT: [[ENTRY:.*:]]
1212
// CHECK-NEXT: [[AGG_TEMP_SROA_0_0_COPYLOAD:%.*]] = load ptr, ptr [[P]], align 8
1313
// CHECK-NEXT: ret ptr [[AGG_TEMP_SROA_0_0_COPYLOAD]]
@@ -44,7 +44,7 @@ int *__counted_by_or_null(count) cbn_in_from_single(int count, int *__single p)
4444
}
4545

4646
// CHECK-LABEL: define dso_local ptr @sb_in_from_bidi(
47-
// CHECK-SAME: i32 noundef [[SIZE:%.*]], ptr noundef readonly captures(none) [[P:%.*]]) local_unnamed_addr #[[ATTR0]] {
47+
// CHECK-SAME: i32 noundef [[SIZE:%.*]], ptr dead_on_return noundef readonly captures(none) [[P:%.*]]) local_unnamed_addr #[[ATTR0]] {
4848
// CHECK-NEXT: [[ENTRY:.*:]]
4949
// CHECK-NEXT: [[AGG_TEMP_SROA_0_0_COPYLOAD:%.*]] = load ptr, ptr [[P]], align 8
5050
// CHECK-NEXT: ret ptr [[AGG_TEMP_SROA_0_0_COPYLOAD]]
@@ -54,7 +54,7 @@ void *__sized_by(size) sb_in_from_bidi(int size, void *__bidi_indexable p) {
5454
}
5555

5656
// CHECK-LABEL: define dso_local ptr @eb_from_bidi(
57-
// CHECK-SAME: ptr noundef readnone captures(none) [[END:%.*]], ptr noundef readonly captures(none) [[P:%.*]]) local_unnamed_addr #[[ATTR0]] {
57+
// CHECK-SAME: ptr noundef readnone captures(none) [[END:%.*]], ptr dead_on_return noundef readonly captures(none) [[P:%.*]]) local_unnamed_addr #[[ATTR0]] {
5858
// CHECK-NEXT: [[ENTRY:.*:]]
5959
// CHECK-NEXT: [[AGG_TEMP_SROA_0_0_COPYLOAD:%.*]] = load ptr, ptr [[P]], align 8
6060
// CHECK-NEXT: ret ptr [[AGG_TEMP_SROA_0_0_COPYLOAD]]

0 commit comments

Comments
 (0)