Skip to content

Commit 8535cf3

Browse files
[BoundsSafety] Fix BoundsSafety tests
rdar://145877334
1 parent 065c58e commit 8535cf3

File tree

3 files changed

+45
-48
lines changed

3 files changed

+45
-48
lines changed

clang/test/BoundsSafety/AST/ended_by_const_param.c

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// FileCheck lines automatically generated using make-ast-dump-check-v2.py
2-
// REQUIRES: apple-disclosure-ios
32

43
// RUN: %clang_cc1 -triple x86_64-apple-mac -ast-dump -fbounds-safety %s 2>&1 | FileCheck %s
54
// RUN: %clang_cc1 -triple x86_64-apple-mac -ast-dump -fbounds-safety -x objective-c -fbounds-attributes-objc-experimental %s 2>&1 | FileCheck %s
@@ -16,7 +15,7 @@ struct S {
1615
// CHECK-NEXT: | `-CompoundStmt {{.+}}
1716
// CHECK-NEXT: | `-DeclStmt {{.+}}
1817
// CHECK-NEXT: | `-VarDecl {{.+}} local 'int *__bidi_indexable' cinit
19-
// CHECK-NEXT: | `-FirebloomPointerPromotionExpr {{.+}} 'int *__bidi_indexable'
18+
// CHECK-NEXT: | `-BoundsSafetyPointerPromotionExpr {{.+}} 'int *__bidi_indexable'
2019
// CHECK-NEXT: | |-DeclRefExpr {{.+}} 'int *__single /* __started_by(start) */ const':'int *__singleconst' lvalue ParmVar {{.+}} 'end' 'int *__single /* __started_by(start) */ const':'int *__singleconst'
2120
// CHECK-NEXT: | |-ImplicitCastExpr {{.+}} 'int *__single /* __started_by(start) */ const':'int *__singleconst' <LValueToRValue>
2221
// CHECK-NEXT: | | `-DeclRefExpr {{.+}} 'int *__single /* __started_by(start) */ const':'int *__singleconst' lvalue ParmVar {{.+}} 'end' 'int *__single /* __started_by(start) */ const':'int *__singleconst'
@@ -36,35 +35,35 @@ void foo(int * const __ended_by(end) start, int* const end) {
3635
// CHECK-NEXT: | | |-CallExpr {{.+}} 'void'
3736
// CHECK-NEXT: | | | |-ImplicitCastExpr {{.+}} 'void (*__single)(int *__single __ended_by(end)const, int *__single /* __started_by(start) */ const)' <FunctionToPointerDecay>
3837
// CHECK-NEXT: | | | | `-DeclRefExpr {{.+}} 'void (int *__single __ended_by(end)const, int *__single /* __started_by(start) */ const)' Function {{.+}} 'foo' 'void (int *__single __ended_by(end)const, int *__single /* __started_by(start) */ const)'
39-
// CHECK-NEXT: | | | |-ImplicitCastExpr {{.+}} 'int *__single __ended_by(end)':'int *__single' <FirebloomPointerCast>
38+
// CHECK-NEXT: | | | |-ImplicitCastExpr {{.+}} 'int *__single __ended_by(end)':'int *__single' <BoundsSafetyPointerCast>
4039
// CHECK-NEXT: | | | | `-OpaqueValueExpr {{.+}} 'int *__bidi_indexable'
4140
// CHECK-NEXT: | | | | `-ImplicitCastExpr {{.+}} 'int *__bidi_indexable' <ArrayToPointerDecay>
4241
// CHECK-NEXT: | | | | `-DeclRefExpr {{.+}} 'int[40]' lvalue Var {{.+}} 'arr' 'int[40]'
43-
// CHECK-NEXT: | | | `-ImplicitCastExpr {{.+}} 'int *__single /* __started_by(start) */ ':'int *__single' <FirebloomPointerCast>
42+
// CHECK-NEXT: | | | `-ImplicitCastExpr {{.+}} 'int *__single /* __started_by(start) */ ':'int *__single' <BoundsSafetyPointerCast>
4443
// CHECK-NEXT: | | | `-OpaqueValueExpr {{.+}} 'int *__bidi_indexable'
4544
// CHECK-NEXT: | | | `-BinaryOperator {{.+}} 'int *__bidi_indexable' '+'
4645
// CHECK-NEXT: | | | |-ImplicitCastExpr {{.+}} 'int *__bidi_indexable' <ArrayToPointerDecay>
4746
// CHECK-NEXT: | | | | `-DeclRefExpr {{.+}} 'int[40]' lvalue Var {{.+}} 'arr' 'int[40]'
4847
// CHECK-NEXT: | | | `-IntegerLiteral {{.+}} 'int' 40
4948
// CHECK-NEXT: | | `-BinaryOperator {{.+}} 'int' '&&'
5049
// CHECK-NEXT: | | |-BinaryOperator {{.+}} 'int' '<='
51-
// CHECK-NEXT: | | | |-ImplicitCastExpr {{.+}} 'int *' <FirebloomPointerCast>
50+
// CHECK-NEXT: | | | |-ImplicitCastExpr {{.+}} 'int *' <BoundsSafetyPointerCast>
5251
// CHECK-NEXT: | | | | `-OpaqueValueExpr {{.+}} 'int *__bidi_indexable'
5352
// CHECK-NEXT: | | | | `-BinaryOperator {{.+}} 'int *__bidi_indexable' '+'
5453
// CHECK-NEXT: | | | | |-ImplicitCastExpr {{.+}} 'int *__bidi_indexable' <ArrayToPointerDecay>
5554
// CHECK-NEXT: | | | | | `-DeclRefExpr {{.+}} 'int[40]' lvalue Var {{.+}} 'arr' 'int[40]'
5655
// CHECK-NEXT: | | | | `-IntegerLiteral {{.+}} 'int' 40
57-
// CHECK-NEXT: | | | `-ImplicitCastExpr {{.+}} 'int *' <FirebloomPointerCast>
56+
// CHECK-NEXT: | | | `-ImplicitCastExpr {{.+}} 'int *' <BoundsSafetyPointerCast>
5857
// CHECK-NEXT: | | | `-GetBoundExpr {{.+}} 'int *__bidi_indexable' upper
5958
// CHECK-NEXT: | | | `-OpaqueValueExpr {{.+}} 'int *__bidi_indexable'
6059
// CHECK-NEXT: | | | `-ImplicitCastExpr {{.+}} 'int *__bidi_indexable' <ArrayToPointerDecay>
6160
// CHECK-NEXT: | | | `-DeclRefExpr {{.+}} 'int[40]' lvalue Var {{.+}} 'arr' 'int[40]'
6261
// CHECK-NEXT: | | `-BinaryOperator {{.+}} 'int' '<='
63-
// CHECK-NEXT: | | |-ImplicitCastExpr {{.+}} 'int *' <FirebloomPointerCast>
62+
// CHECK-NEXT: | | |-ImplicitCastExpr {{.+}} 'int *' <BoundsSafetyPointerCast>
6463
// CHECK-NEXT: | | | `-OpaqueValueExpr {{.+}} 'int *__bidi_indexable'
6564
// CHECK-NEXT: | | | `-ImplicitCastExpr {{.+}} 'int *__bidi_indexable' <ArrayToPointerDecay>
6665
// CHECK-NEXT: | | | `-DeclRefExpr {{.+}} 'int[40]' lvalue Var {{.+}} 'arr' 'int[40]'
67-
// CHECK-NEXT: | | `-ImplicitCastExpr {{.+}} 'int *' <FirebloomPointerCast>
66+
// CHECK-NEXT: | | `-ImplicitCastExpr {{.+}} 'int *' <BoundsSafetyPointerCast>
6867
// CHECK-NEXT: | | `-OpaqueValueExpr {{.+}} 'int *__bidi_indexable'
6968
// CHECK-NEXT: | | `-BinaryOperator {{.+}} 'int *__bidi_indexable' '+'
7069
// CHECK-NEXT: | | |-ImplicitCastExpr {{.+}} 'int *__bidi_indexable' <ArrayToPointerDecay>
@@ -89,4 +88,4 @@ void foo(int * const __ended_by(end) start, int* const end) {
8988
void bar(void) {
9089
int arr[40];
9190
foo(arr, arr + 40);
92-
}
91+
}

clang/test/BoundsSafety/CodeGen/ended_by_const_param-O2.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 5
2-
// REQUIRES: apple-disclosure-ios
32
// RUN: %clang_cc1 -O2 -triple arm64-apple-iphoneos -fbounds-safety -emit-llvm %s -o - | FileCheck %s
43

54
#include <ptrcheck.h>
@@ -86,5 +85,5 @@ void oob_order(void) {
8685
foo(arr + 2, arr + 1);
8786
}
8887
//.
89-
// CHECK: [[META2]] = !{!"firebloom-generic"}
88+
// CHECK: [[META2]] = !{!"bounds-safety-generic"}
9089
//.
Lines changed: 36 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 5
2-
// REQUIRES: apple-disclosure-ios
32
// RUN: %clang_cc1 -O0 -triple arm64-apple-iphoneos -fbounds-safety -emit-llvm %s -o - | FileCheck %s
43

54
#include <ptrcheck.h>
@@ -14,17 +13,17 @@ struct S {
1413
// CHECK-NEXT: [[ENTRY:.*:]]
1514
// CHECK-NEXT: [[START_ADDR:%.*]] = alloca ptr, align 8
1615
// CHECK-NEXT: [[END_ADDR:%.*]] = alloca ptr, align 8
17-
// CHECK-NEXT: [[LOCAL:%.*]] = alloca %"__firebloom::wide_ptr.bidi_indexable", align 8
16+
// CHECK-NEXT: [[LOCAL:%.*]] = alloca %"__bounds_safety::wide_ptr.bidi_indexable", align 8
1817
// CHECK-NEXT: store ptr [[START]], ptr [[START_ADDR]], align 8
1918
// CHECK-NEXT: store ptr [[END]], ptr [[END_ADDR]], align 8
2019
// CHECK-NEXT: [[TMP0:%.*]] = load ptr, ptr [[END_ADDR]], align 8
2120
// CHECK-NEXT: [[TMP1:%.*]] = load ptr, ptr [[START_ADDR]], align 8
2221
// CHECK-NEXT: [[TMP2:%.*]] = load ptr, ptr [[END_ADDR]], align 8
23-
// CHECK-NEXT: [[TMP3:%.*]] = getelementptr inbounds nuw %"__firebloom::wide_ptr.bidi_indexable", ptr [[LOCAL]], i32 0, i32 0
22+
// CHECK-NEXT: [[TMP3:%.*]] = getelementptr inbounds %"__bounds_safety::wide_ptr.bidi_indexable", ptr [[LOCAL]], i32 0, i32 0
2423
// CHECK-NEXT: store ptr [[TMP0]], ptr [[TMP3]], align 8
25-
// CHECK-NEXT: [[TMP4:%.*]] = getelementptr inbounds nuw %"__firebloom::wide_ptr.bidi_indexable", ptr [[LOCAL]], i32 0, i32 1
24+
// CHECK-NEXT: [[TMP4:%.*]] = getelementptr inbounds %"__bounds_safety::wide_ptr.bidi_indexable", ptr [[LOCAL]], i32 0, i32 1
2625
// CHECK-NEXT: store ptr [[TMP2]], ptr [[TMP4]], align 8
27-
// CHECK-NEXT: [[TMP5:%.*]] = getelementptr inbounds nuw %"__firebloom::wide_ptr.bidi_indexable", ptr [[LOCAL]], i32 0, i32 2
26+
// CHECK-NEXT: [[TMP5:%.*]] = getelementptr inbounds %"__bounds_safety::wide_ptr.bidi_indexable", ptr [[LOCAL]], i32 0, i32 2
2827
// CHECK-NEXT: store ptr [[TMP1]], ptr [[TMP5]], align 8
2928
// CHECK-NEXT: ret void
3029
//
@@ -36,55 +35,55 @@ void foo(int * const __ended_by(end) start, int* const end) {
3635
// CHECK-SAME: ) #[[ATTR0]] {
3736
// CHECK-NEXT: [[ENTRY:.*:]]
3837
// CHECK-NEXT: [[ARR:%.*]] = alloca [40 x i32], align 4
39-
// CHECK-NEXT: [[AGG_TEMP:%.*]] = alloca %"__firebloom::wide_ptr.bidi_indexable", align 8
40-
// CHECK-NEXT: [[AGG_TEMP1:%.*]] = alloca %"__firebloom::wide_ptr.bidi_indexable", align 8
41-
// CHECK-NEXT: [[TMP:%.*]] = alloca %"__firebloom::wide_ptr.bidi_indexable", align 8
42-
// CHECK-NEXT: [[AGG_TEMP4:%.*]] = alloca %"__firebloom::wide_ptr.bidi_indexable", align 8
43-
// CHECK-NEXT: [[AGG_TEMP5:%.*]] = alloca %"__firebloom::wide_ptr.bidi_indexable", align 8
44-
// CHECK-NEXT: [[AGG_TEMP12:%.*]] = alloca %"__firebloom::wide_ptr.bidi_indexable", align 8
45-
// CHECK-NEXT: [[AGG_TEMP19:%.*]] = alloca %"__firebloom::wide_ptr.bidi_indexable", align 8
38+
// CHECK-NEXT: [[AGG_TEMP:%.*]] = alloca %"__bounds_safety::wide_ptr.bidi_indexable", align 8
39+
// CHECK-NEXT: [[AGG_TEMP1:%.*]] = alloca %"__bounds_safety::wide_ptr.bidi_indexable", align 8
40+
// CHECK-NEXT: [[TMP:%.*]] = alloca %"__bounds_safety::wide_ptr.bidi_indexable", align 8
41+
// CHECK-NEXT: [[AGG_TEMP4:%.*]] = alloca %"__bounds_safety::wide_ptr.bidi_indexable", align 8
42+
// CHECK-NEXT: [[AGG_TEMP5:%.*]] = alloca %"__bounds_safety::wide_ptr.bidi_indexable", align 8
43+
// CHECK-NEXT: [[AGG_TEMP12:%.*]] = alloca %"__bounds_safety::wide_ptr.bidi_indexable", align 8
44+
// CHECK-NEXT: [[AGG_TEMP19:%.*]] = alloca %"__bounds_safety::wide_ptr.bidi_indexable", align 8
4645
// CHECK-NEXT: [[ARRAYDECAY:%.*]] = getelementptr inbounds [40 x i32], ptr [[ARR]], i64 0, i64 0
4746
// CHECK-NEXT: [[UPPER:%.*]] = getelementptr inbounds i32, ptr [[ARRAYDECAY]], i64 40
48-
// CHECK-NEXT: [[TMP0:%.*]] = getelementptr inbounds nuw %"__firebloom::wide_ptr.bidi_indexable", ptr [[AGG_TEMP]], i32 0, i32 0
47+
// CHECK-NEXT: [[TMP0:%.*]] = getelementptr inbounds %"__bounds_safety::wide_ptr.bidi_indexable", ptr [[AGG_TEMP]], i32 0, i32 0
4948
// CHECK-NEXT: store ptr [[ARRAYDECAY]], ptr [[TMP0]], align 8
50-
// CHECK-NEXT: [[TMP1:%.*]] = getelementptr inbounds nuw %"__firebloom::wide_ptr.bidi_indexable", ptr [[AGG_TEMP]], i32 0, i32 1
49+
// CHECK-NEXT: [[TMP1:%.*]] = getelementptr inbounds %"__bounds_safety::wide_ptr.bidi_indexable", ptr [[AGG_TEMP]], i32 0, i32 1
5150
// CHECK-NEXT: store ptr [[UPPER]], ptr [[TMP1]], align 8
52-
// CHECK-NEXT: [[TMP2:%.*]] = getelementptr inbounds nuw %"__firebloom::wide_ptr.bidi_indexable", ptr [[AGG_TEMP]], i32 0, i32 2
51+
// CHECK-NEXT: [[TMP2:%.*]] = getelementptr inbounds %"__bounds_safety::wide_ptr.bidi_indexable", ptr [[AGG_TEMP]], i32 0, i32 2
5352
// CHECK-NEXT: store ptr [[ARRAYDECAY]], ptr [[TMP2]], align 8
5453
// CHECK-NEXT: [[ARRAYDECAY2:%.*]] = getelementptr inbounds [40 x i32], ptr [[ARR]], i64 0, i64 0
5554
// CHECK-NEXT: [[UPPER3:%.*]] = getelementptr inbounds i32, ptr [[ARRAYDECAY2]], i64 40
56-
// CHECK-NEXT: [[TMP3:%.*]] = getelementptr inbounds nuw %"__firebloom::wide_ptr.bidi_indexable", ptr [[TMP]], i32 0, i32 0
55+
// CHECK-NEXT: [[TMP3:%.*]] = getelementptr inbounds %"__bounds_safety::wide_ptr.bidi_indexable", ptr [[TMP]], i32 0, i32 0
5756
// CHECK-NEXT: store ptr [[ARRAYDECAY2]], ptr [[TMP3]], align 8
58-
// CHECK-NEXT: [[TMP4:%.*]] = getelementptr inbounds nuw %"__firebloom::wide_ptr.bidi_indexable", ptr [[TMP]], i32 0, i32 1
57+
// CHECK-NEXT: [[TMP4:%.*]] = getelementptr inbounds %"__bounds_safety::wide_ptr.bidi_indexable", ptr [[TMP]], i32 0, i32 1
5958
// CHECK-NEXT: store ptr [[UPPER3]], ptr [[TMP4]], align 8
60-
// CHECK-NEXT: [[TMP5:%.*]] = getelementptr inbounds nuw %"__firebloom::wide_ptr.bidi_indexable", ptr [[TMP]], i32 0, i32 2
59+
// CHECK-NEXT: [[TMP5:%.*]] = getelementptr inbounds %"__bounds_safety::wide_ptr.bidi_indexable", ptr [[TMP]], i32 0, i32 2
6160
// CHECK-NEXT: store ptr [[ARRAYDECAY2]], ptr [[TMP5]], align 8
62-
// CHECK-NEXT: [[TMP6:%.*]] = getelementptr inbounds nuw %"__firebloom::wide_ptr.bidi_indexable", ptr [[TMP]], i32 0, i32 0
61+
// CHECK-NEXT: [[TMP6:%.*]] = getelementptr inbounds %"__bounds_safety::wide_ptr.bidi_indexable", ptr [[TMP]], i32 0, i32 0
6362
// CHECK-NEXT: [[TMP7:%.*]] = load ptr, ptr [[TMP6]], align 8
6463
// CHECK-NEXT: [[BOUND_PTR_ARITH:%.*]] = getelementptr i32, ptr [[TMP7]], i64 40
65-
// CHECK-NEXT: [[TMP8:%.*]] = getelementptr inbounds nuw %"__firebloom::wide_ptr.bidi_indexable", ptr [[AGG_TEMP1]], i32 0, i32 0
64+
// CHECK-NEXT: [[TMP8:%.*]] = getelementptr inbounds %"__bounds_safety::wide_ptr.bidi_indexable", ptr [[AGG_TEMP1]], i32 0, i32 0
6665
// CHECK-NEXT: store ptr [[BOUND_PTR_ARITH]], ptr [[TMP8]], align 8
67-
// CHECK-NEXT: [[TMP9:%.*]] = getelementptr inbounds nuw %"__firebloom::wide_ptr.bidi_indexable", ptr [[TMP]], i32 0, i32 1
66+
// CHECK-NEXT: [[TMP9:%.*]] = getelementptr inbounds %"__bounds_safety::wide_ptr.bidi_indexable", ptr [[TMP]], i32 0, i32 1
6867
// CHECK-NEXT: [[TMP10:%.*]] = load ptr, ptr [[TMP9]], align 8
69-
// CHECK-NEXT: [[TMP11:%.*]] = getelementptr inbounds nuw %"__firebloom::wide_ptr.bidi_indexable", ptr [[AGG_TEMP1]], i32 0, i32 1
68+
// CHECK-NEXT: [[TMP11:%.*]] = getelementptr inbounds %"__bounds_safety::wide_ptr.bidi_indexable", ptr [[AGG_TEMP1]], i32 0, i32 1
7069
// CHECK-NEXT: store ptr [[TMP10]], ptr [[TMP11]], align 8
71-
// CHECK-NEXT: [[TMP12:%.*]] = getelementptr inbounds nuw %"__firebloom::wide_ptr.bidi_indexable", ptr [[TMP]], i32 0, i32 2
70+
// CHECK-NEXT: [[TMP12:%.*]] = getelementptr inbounds %"__bounds_safety::wide_ptr.bidi_indexable", ptr [[TMP]], i32 0, i32 2
7271
// CHECK-NEXT: [[TMP13:%.*]] = load ptr, ptr [[TMP12]], align 8
73-
// CHECK-NEXT: [[TMP14:%.*]] = getelementptr inbounds nuw %"__firebloom::wide_ptr.bidi_indexable", ptr [[AGG_TEMP1]], i32 0, i32 2
72+
// CHECK-NEXT: [[TMP14:%.*]] = getelementptr inbounds %"__bounds_safety::wide_ptr.bidi_indexable", ptr [[AGG_TEMP1]], i32 0, i32 2
7473
// CHECK-NEXT: store ptr [[TMP13]], ptr [[TMP14]], align 8
7574
// CHECK-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 8 [[AGG_TEMP4]], ptr align 8 [[AGG_TEMP]], i64 24, i1 false), !annotation [[META2:![0-9]+]]
76-
// CHECK-NEXT: [[WIDE_PTR_PTR_ADDR:%.*]] = getelementptr inbounds nuw %"__firebloom::wide_ptr.bidi_indexable", ptr [[AGG_TEMP4]], i32 0, i32 0, !annotation [[META2]]
75+
// CHECK-NEXT: [[WIDE_PTR_PTR_ADDR:%.*]] = getelementptr inbounds %"__bounds_safety::wide_ptr.bidi_indexable", ptr [[AGG_TEMP4]], i32 0, i32 0, !annotation [[META2]]
7776
// CHECK-NEXT: [[WIDE_PTR_PTR:%.*]] = load ptr, ptr [[WIDE_PTR_PTR_ADDR]], align 8, !annotation [[META2]]
78-
// CHECK-NEXT: [[WIDE_PTR_UB_ADDR:%.*]] = getelementptr inbounds nuw %"__firebloom::wide_ptr.bidi_indexable", ptr [[AGG_TEMP4]], i32 0, i32 1, !annotation [[META2]]
77+
// CHECK-NEXT: [[WIDE_PTR_UB_ADDR:%.*]] = getelementptr inbounds %"__bounds_safety::wide_ptr.bidi_indexable", ptr [[AGG_TEMP4]], i32 0, i32 1, !annotation [[META2]]
7978
// CHECK-NEXT: [[WIDE_PTR_UB:%.*]] = load ptr, ptr [[WIDE_PTR_UB_ADDR]], align 8, !annotation [[META2]]
80-
// CHECK-NEXT: [[WIDE_PTR_LB_ADDR:%.*]] = getelementptr inbounds nuw %"__firebloom::wide_ptr.bidi_indexable", ptr [[AGG_TEMP4]], i32 0, i32 2, !annotation [[META2]]
79+
// CHECK-NEXT: [[WIDE_PTR_LB_ADDR:%.*]] = getelementptr inbounds %"__bounds_safety::wide_ptr.bidi_indexable", ptr [[AGG_TEMP4]], i32 0, i32 2, !annotation [[META2]]
8180
// CHECK-NEXT: [[WIDE_PTR_LB:%.*]] = load ptr, ptr [[WIDE_PTR_LB_ADDR]], align 8, !annotation [[META2]]
8281
// CHECK-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 8 [[AGG_TEMP5]], ptr align 8 [[AGG_TEMP1]], i64 24, i1 false), !annotation [[META2]]
83-
// CHECK-NEXT: [[WIDE_PTR_PTR_ADDR6:%.*]] = getelementptr inbounds nuw %"__firebloom::wide_ptr.bidi_indexable", ptr [[AGG_TEMP5]], i32 0, i32 0, !annotation [[META2]]
82+
// CHECK-NEXT: [[WIDE_PTR_PTR_ADDR6:%.*]] = getelementptr inbounds %"__bounds_safety::wide_ptr.bidi_indexable", ptr [[AGG_TEMP5]], i32 0, i32 0, !annotation [[META2]]
8483
// CHECK-NEXT: [[WIDE_PTR_PTR7:%.*]] = load ptr, ptr [[WIDE_PTR_PTR_ADDR6]], align 8, !annotation [[META2]]
85-
// CHECK-NEXT: [[WIDE_PTR_UB_ADDR8:%.*]] = getelementptr inbounds nuw %"__firebloom::wide_ptr.bidi_indexable", ptr [[AGG_TEMP5]], i32 0, i32 1, !annotation [[META2]]
84+
// CHECK-NEXT: [[WIDE_PTR_UB_ADDR8:%.*]] = getelementptr inbounds %"__bounds_safety::wide_ptr.bidi_indexable", ptr [[AGG_TEMP5]], i32 0, i32 1, !annotation [[META2]]
8685
// CHECK-NEXT: [[WIDE_PTR_UB9:%.*]] = load ptr, ptr [[WIDE_PTR_UB_ADDR8]], align 8, !annotation [[META2]]
87-
// CHECK-NEXT: [[WIDE_PTR_LB_ADDR10:%.*]] = getelementptr inbounds nuw %"__firebloom::wide_ptr.bidi_indexable", ptr [[AGG_TEMP5]], i32 0, i32 2, !annotation [[META2]]
86+
// CHECK-NEXT: [[WIDE_PTR_LB_ADDR10:%.*]] = getelementptr inbounds %"__bounds_safety::wide_ptr.bidi_indexable", ptr [[AGG_TEMP5]], i32 0, i32 2, !annotation [[META2]]
8887
// CHECK-NEXT: [[WIDE_PTR_LB11:%.*]] = load ptr, ptr [[WIDE_PTR_LB_ADDR10]], align 8, !annotation [[META2]]
8988
// CHECK-NEXT: [[CMP:%.*]] = icmp ule ptr [[WIDE_PTR_PTR]], [[WIDE_PTR_PTR7]], !annotation [[META2]]
9089
// CHECK-NEXT: br i1 [[CMP]], label %[[CONT:.*]], label %[[TRAP:.*]], !annotation [[META2]]
@@ -93,18 +92,18 @@ void foo(int * const __ended_by(end) start, int* const end) {
9392
// CHECK-NEXT: unreachable, !annotation [[META2]]
9493
// CHECK: [[CONT]]:
9594
// CHECK-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 8 [[AGG_TEMP12]], ptr align 8 [[AGG_TEMP]], i64 24, i1 false)
96-
// CHECK-NEXT: [[WIDE_PTR_PTR_ADDR13:%.*]] = getelementptr inbounds nuw %"__firebloom::wide_ptr.bidi_indexable", ptr [[AGG_TEMP12]], i32 0, i32 0
95+
// CHECK-NEXT: [[WIDE_PTR_PTR_ADDR13:%.*]] = getelementptr inbounds %"__bounds_safety::wide_ptr.bidi_indexable", ptr [[AGG_TEMP12]], i32 0, i32 0
9796
// CHECK-NEXT: [[WIDE_PTR_PTR14:%.*]] = load ptr, ptr [[WIDE_PTR_PTR_ADDR13]], align 8
98-
// CHECK-NEXT: [[WIDE_PTR_UB_ADDR15:%.*]] = getelementptr inbounds nuw %"__firebloom::wide_ptr.bidi_indexable", ptr [[AGG_TEMP12]], i32 0, i32 1
97+
// CHECK-NEXT: [[WIDE_PTR_UB_ADDR15:%.*]] = getelementptr inbounds %"__bounds_safety::wide_ptr.bidi_indexable", ptr [[AGG_TEMP12]], i32 0, i32 1
9998
// CHECK-NEXT: [[WIDE_PTR_UB16:%.*]] = load ptr, ptr [[WIDE_PTR_UB_ADDR15]], align 8
100-
// CHECK-NEXT: [[WIDE_PTR_LB_ADDR17:%.*]] = getelementptr inbounds nuw %"__firebloom::wide_ptr.bidi_indexable", ptr [[AGG_TEMP12]], i32 0, i32 2
99+
// CHECK-NEXT: [[WIDE_PTR_LB_ADDR17:%.*]] = getelementptr inbounds %"__bounds_safety::wide_ptr.bidi_indexable", ptr [[AGG_TEMP12]], i32 0, i32 2
101100
// CHECK-NEXT: [[WIDE_PTR_LB18:%.*]] = load ptr, ptr [[WIDE_PTR_LB_ADDR17]], align 8
102101
// CHECK-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 8 [[AGG_TEMP19]], ptr align 8 [[AGG_TEMP1]], i64 24, i1 false)
103-
// CHECK-NEXT: [[WIDE_PTR_PTR_ADDR20:%.*]] = getelementptr inbounds nuw %"__firebloom::wide_ptr.bidi_indexable", ptr [[AGG_TEMP19]], i32 0, i32 0
102+
// CHECK-NEXT: [[WIDE_PTR_PTR_ADDR20:%.*]] = getelementptr inbounds %"__bounds_safety::wide_ptr.bidi_indexable", ptr [[AGG_TEMP19]], i32 0, i32 0
104103
// CHECK-NEXT: [[WIDE_PTR_PTR21:%.*]] = load ptr, ptr [[WIDE_PTR_PTR_ADDR20]], align 8
105-
// CHECK-NEXT: [[WIDE_PTR_UB_ADDR22:%.*]] = getelementptr inbounds nuw %"__firebloom::wide_ptr.bidi_indexable", ptr [[AGG_TEMP19]], i32 0, i32 1
104+
// CHECK-NEXT: [[WIDE_PTR_UB_ADDR22:%.*]] = getelementptr inbounds %"__bounds_safety::wide_ptr.bidi_indexable", ptr [[AGG_TEMP19]], i32 0, i32 1
106105
// CHECK-NEXT: [[WIDE_PTR_UB23:%.*]] = load ptr, ptr [[WIDE_PTR_UB_ADDR22]], align 8
107-
// CHECK-NEXT: [[WIDE_PTR_LB_ADDR24:%.*]] = getelementptr inbounds nuw %"__firebloom::wide_ptr.bidi_indexable", ptr [[AGG_TEMP19]], i32 0, i32 2
106+
// CHECK-NEXT: [[WIDE_PTR_LB_ADDR24:%.*]] = getelementptr inbounds %"__bounds_safety::wide_ptr.bidi_indexable", ptr [[AGG_TEMP19]], i32 0, i32 2
108107
// CHECK-NEXT: [[WIDE_PTR_LB25:%.*]] = load ptr, ptr [[WIDE_PTR_LB_ADDR24]], align 8
109108
// CHECK-NEXT: call void @foo(ptr noundef [[WIDE_PTR_PTR14]], ptr noundef [[WIDE_PTR_PTR21]])
110109
// CHECK-NEXT: ret void
@@ -114,5 +113,5 @@ void bar(void) {
114113
foo(arr, arr + 40);
115114
}
116115
//.
117-
// CHECK: [[META2]] = !{!"firebloom-generic"}
116+
// CHECK: [[META2]] = !{!"bounds-safety-generic"}
118117
//.

0 commit comments

Comments
 (0)