Skip to content

Commit 2299515

Browse files
[BoundsSafety] Fix CodeGen tests (NFC)
The CodeGen tests started failing after de89575, which causes some stores to be removed in our tests that compile with -O2. rdar://147052569
1 parent ab4d429 commit 2299515

File tree

5 files changed

+56
-60
lines changed

5 files changed

+56
-60
lines changed

clang/test/BoundsSafety/CodeGen/addrof-member-to-single-O2.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ char **addrof_bidi_ptr_to_single_oob_upper(void) {
6767
// CHECK-NEXT: entry:
6868
// CHECK-NEXT: [[F:%.*]] = alloca [[STRUCT_FOO:%.*]], align 8
6969
// CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 24, ptr nonnull [[F]]) #[[ATTR6:[0-9]+]]
70-
// CHECK-NEXT: store ptr null, ptr [[F]], align 8, {{!annotation ![0-9]+}}
7170
// CHECK-NEXT: [[TMP0:%.*]] = getelementptr inbounds nuw i8, ptr [[F]], i64 24
7271
// CHECK-NEXT: [[BOUND_PTR_ARITH:%.*]] = getelementptr i8, ptr [[F]], i64 -24
7372
// CHECK-NEXT: [[TMP1:%.*]] = icmp ult ptr [[BOUND_PTR_ARITH]], [[TMP0]], {{!annotation ![0-9]+}}
@@ -119,7 +118,6 @@ int *addrof_bidi_i_to_single_oob_upper(void) {
119118
// CHECK-NEXT: entry:
120119
// CHECK-NEXT: [[F:%.*]] = alloca [[STRUCT_FOO:%.*]], align 8
121120
// CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 24, ptr nonnull [[F]]) #[[ATTR6]]
122-
// CHECK-NEXT: store ptr null, ptr [[F]], align 8, {{!annotation ![0-9]+}}
123121
// CHECK-NEXT: [[TMP0:%.*]] = getelementptr inbounds nuw i8, ptr [[F]], i64 24
124122
// CHECK-NEXT: [[BOUND_PTR_ARITH:%.*]] = getelementptr i8, ptr [[F]], i64 -24
125123
// CHECK-NEXT: [[TMP1:%.*]] = icmp ult ptr [[BOUND_PTR_ARITH]], [[TMP0]], {{!annotation ![0-9]+}}
@@ -172,7 +170,6 @@ long *addrof_bidi_l_to_single_oob_upper(void) {
172170
// CHECK-NEXT: entry:
173171
// CHECK-NEXT: [[F:%.*]] = alloca [[STRUCT_FOO:%.*]], align 8
174172
// CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 24, ptr nonnull [[F]]) #[[ATTR6]]
175-
// CHECK-NEXT: store ptr null, ptr [[F]], align 8, {{!annotation ![0-9]+}}
176173
// CHECK-NEXT: [[TMP0:%.*]] = getelementptr inbounds nuw i8, ptr [[F]], i64 24
177174
// CHECK-NEXT: [[BOUND_PTR_ARITH:%.*]] = getelementptr i8, ptr [[F]], i64 -24
178175
// CHECK-NEXT: [[TMP1:%.*]] = icmp ult ptr [[BOUND_PTR_ARITH]], [[TMP0]], {{!annotation ![0-9]+}}

clang/test/BoundsSafety/CodeGen/count-dependent-assignment-checks/dep-count-init-list-basic-O2.c

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ struct S {
1111

1212
// CHECK-LABEL: @TestInitFail1(
1313
// CHECK-NEXT: entry:
14-
// CHECK-NEXT: tail call void @llvm.ubsantrap(i8 25) #[[ATTR6:[0-9]+]], {{!annotation ![0-9]+}}
14+
// CHECK-NEXT: tail call void @llvm.ubsantrap(i8 25) #[[ATTR5:[0-9]+]], {{!annotation ![0-9]+}}
1515
// CHECK-NEXT: unreachable, {{!annotation ![0-9]+}}
1616
//
1717
void TestInitFail1() {
@@ -22,7 +22,7 @@ void TestInitFail1() {
2222

2323
// CHECK-LABEL: @TestInitFail2(
2424
// CHECK-NEXT: entry:
25-
// CHECK-NEXT: tail call void @llvm.ubsantrap(i8 25) #[[ATTR6]], {{!annotation ![0-9]+}}
25+
// CHECK-NEXT: tail call void @llvm.ubsantrap(i8 25) #[[ATTR5]], {{!annotation ![0-9]+}}
2626
// CHECK-NEXT: unreachable, {{!annotation ![0-9]+}}
2727
//
2828
void TestInitFail2() {
@@ -39,7 +39,7 @@ struct SU {
3939

4040
// CHECK-LABEL: @TestUInitFail(
4141
// CHECK-NEXT: entry:
42-
// CHECK-NEXT: tail call void @llvm.ubsantrap(i8 25) #[[ATTR6]], {{!annotation ![0-9]+}}
42+
// CHECK-NEXT: tail call void @llvm.ubsantrap(i8 25) #[[ATTR5]], {{!annotation ![0-9]+}}
4343
// CHECK-NEXT: unreachable, {{!annotation ![0-9]+}}
4444
//
4545
void TestUInitFail() {
@@ -83,7 +83,7 @@ void TestAccessOK() {
8383

8484
// CHECK-LABEL: @TestAccessFail(
8585
// CHECK-NEXT: entry:
86-
// CHECK-NEXT: tail call void @llvm.ubsantrap(i8 25) #[[ATTR6]], {{!annotation ![0-9]+}}
86+
// CHECK-NEXT: tail call void @llvm.ubsantrap(i8 25) #[[ATTR5]], {{!annotation ![0-9]+}}
8787
// CHECK-NEXT: unreachable, {{!annotation ![0-9]+}}
8888
//
8989
void TestAccessFail() {
@@ -96,19 +96,18 @@ void TestAccessFail() {
9696
// CHECK-LABEL: @TestAccessFail2(
9797
// CHECK-NEXT: entry:
9898
// CHECK-NEXT: [[ARR:%.*]] = alloca [9 x i32], align 16
99-
// CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 36, ptr nonnull [[ARR]]) #[[ATTR7:[0-9]+]]
100-
// CHECK-NEXT: call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(36) [[ARR]], i8 0, i64 36, i1 false)
99+
// CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 36, ptr nonnull [[ARR]]) #[[ATTR6:[0-9]+]]
101100
// CHECK-NEXT: [[UPPER:%.*]] = getelementptr inbounds nuw i8, ptr [[ARR]], i64 36
102-
// CHECK-NEXT: [[TMP0:%.*]] = getelementptr i8, ptr [[ARR]], i64 -4
103-
// CHECK-NEXT: [[TMP1:%.*]] = icmp ult ptr [[TMP0]], [[UPPER]], {{!annotation ![0-9]+}}
104-
// CHECK-NEXT: [[TMP2:%.*]] = icmp uge ptr [[TMP0]], [[ARR]], {{!annotation ![0-9]+}}
105-
// CHECK-NEXT: [[OR_COND:%.*]] = and i1 [[TMP1]], [[TMP2]], {{!annotation ![0-9]+}}
101+
// CHECK-NEXT: [[ARRAYIDX:%.*]] = getelementptr i8, ptr [[ARR]], i64 -4
102+
// CHECK-NEXT: [[TMP0:%.*]] = icmp ult ptr [[ARRAYIDX]], [[UPPER]], {{!annotation ![0-9]+}}
103+
// CHECK-NEXT: [[TMP1:%.*]] = icmp uge ptr [[ARRAYIDX]], [[ARR]], {{!annotation ![0-9]+}}
104+
// CHECK-NEXT: [[OR_COND:%.*]] = and i1 [[TMP0]], [[TMP1]], {{!annotation ![0-9]+}}
106105
// CHECK-NEXT: br i1 [[OR_COND]], label [[CONT47:%.*]], label [[TRAP:%.*]], {{!annotation ![0-9]+}}
107106
// CHECK: trap:
108-
// CHECK-NEXT: call void @llvm.ubsantrap(i8 25) #[[ATTR6]], {{!annotation ![0-9]+}}
107+
// CHECK-NEXT: call void @llvm.ubsantrap(i8 25) #[[ATTR5]], {{!annotation ![0-9]+}}
109108
// CHECK-NEXT: unreachable, {{!annotation ![0-9]+}}
110109
// CHECK: cont47:
111-
// CHECK-NEXT: call void @llvm.lifetime.end.p0(i64 36, ptr nonnull [[ARR]]) #[[ATTR7]]
110+
// CHECK-NEXT: call void @llvm.lifetime.end.p0(i64 36, ptr nonnull [[ARR]]) #[[ATTR6]]
112111
// CHECK-NEXT: ret void
113112
//
114113
void TestAccessFail2() {
@@ -120,7 +119,7 @@ void TestAccessFail2() {
120119

121120
// CHECK-LABEL: @TestAccessFail3(
122121
// CHECK-NEXT: entry:
123-
// CHECK-NEXT: tail call void @llvm.ubsantrap(i8 25) #[[ATTR6]], {{!annotation ![0-9]+}}
122+
// CHECK-NEXT: tail call void @llvm.ubsantrap(i8 25) #[[ATTR5]], {{!annotation ![0-9]+}}
124123
// CHECK-NEXT: unreachable, {{!annotation ![0-9]+}}
125124
//
126125
void TestAccessFail3() {
Lines changed: 35 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1+
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 5
12
// REQUIRES: system-darwin
2-
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --replace-value-regex "!annotation ![0-9]+" "!tbaa ![0-9]+" "!tbaa\.struct ![0-9]+" "!nosanitize ![0-9]+" "!srcloc ![0-9]+" --prefix-filecheck-ir-name TMP_
3-
43

54
// RUN: %clang_cc1 -O2 -triple x86_64 -fbounds-safety -emit-llvm %s -o - | FileCheck --check-prefixes O2 %s
65
// RUN: %clang_cc1 -O0 -triple x86_64 -fbounds-safety -emit-llvm %s -o - | FileCheck --check-prefixes O0 %s
@@ -12,34 +11,33 @@ struct S {
1211
long i;
1312
};
1413

15-
// O2-LABEL: @foo(
16-
// O2-NEXT: entry:
14+
// O2-LABEL: define dso_local void @foo(
15+
// O2-SAME: ptr noundef readnone captures(none) [[A:%.*]], i64 noundef [[I:%.*]]) local_unnamed_addr #[[ATTR0:[0-9]+]] {
16+
// O2-NEXT: [[ENTRY:.*:]]
1717
// O2-NEXT: [[S:%.*]] = alloca [[STRUCT_S:%.*]], align 8
1818
// O2-NEXT: call void @llvm.lifetime.start.p0(i64 16, ptr nonnull [[S]]) #[[ATTR3:[0-9]+]]
19-
// O2-NEXT: store ptr [[A:%.*]], ptr [[S]], align 8, {{!tbaa ![0-9]+}}
20-
// O2-NEXT: [[I1:%.*]] = getelementptr inbounds nuw i8, ptr [[S]], i64 8
21-
// O2-NEXT: store i64 [[I:%.*]], ptr [[I1]], align 8, {{!tbaa ![0-9]+}}
2219
// O2-NEXT: [[TMP0:%.*]] = getelementptr inbounds nuw i8, ptr [[S]], i64 16
2320
// O2-NEXT: [[TMP1:%.*]] = getelementptr i8, ptr [[S]], i64 24
24-
// O2-NEXT: [[DOTNOT:%.*]] = icmp ugt ptr [[TMP1]], [[TMP0]], {{!annotation ![0-9]+}}
25-
// O2-NEXT: br i1 [[DOTNOT]], label [[TRAP:%.*]], label [[CONT9:%.*]], {{!annotation ![0-9]+}}
26-
// O2: trap:
27-
// O2-NEXT: call void @llvm.ubsantrap(i8 25) #[[ATTR4:[0-9]+]], {{!annotation ![0-9]+}}
28-
// O2-NEXT: unreachable, {{!annotation ![0-9]+}}
29-
// O2: cont9:
21+
// O2-NEXT: [[DOTNOT:%.*]] = icmp ugt ptr [[TMP1]], [[TMP0]], !annotation [[META2:![0-9]+]]
22+
// O2-NEXT: br i1 [[DOTNOT]], label %[[TRAP:.*]], label %[[CONT9:.*]], !annotation [[META2]]
23+
// O2: [[TRAP]]:
24+
// O2-NEXT: call void @llvm.ubsantrap(i8 25) #[[ATTR4:[0-9]+]], !annotation [[META3:![0-9]+]]
25+
// O2-NEXT: unreachable, !annotation [[META3]]
26+
// O2: [[CONT9]]:
3027
// O2-NEXT: call void @llvm.lifetime.end.p0(i64 16, ptr nonnull [[S]]) #[[ATTR3]]
3128
// O2-NEXT: ret void
3229
//
33-
// O0-LABEL: @foo(
34-
// O0-NEXT: entry:
30+
// O0-LABEL: define dso_local void @foo(
31+
// O0-SAME: ptr noundef [[A:%.*]], i64 noundef [[I:%.*]]) #[[ATTR0:[0-9]+]] {
32+
// O0-NEXT: [[ENTRY:.*:]]
3533
// O0-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 8
3634
// O0-NEXT: [[I_ADDR:%.*]] = alloca i64, align 8
3735
// O0-NEXT: [[S:%.*]] = alloca [[STRUCT_S:%.*]], align 8
3836
// O0-NEXT: [[SP:%.*]] = alloca %"__bounds_safety::wide_ptr.bidi_indexable", align 8
3937
// O0-NEXT: [[AGG_TEMP:%.*]] = alloca %"__bounds_safety::wide_ptr.bidi_indexable.0", align 8
4038
// O0-NEXT: [[AGG_TEMP2:%.*]] = alloca %"__bounds_safety::wide_ptr.bidi_indexable", align 8
41-
// O0-NEXT: store ptr [[A:%.*]], ptr [[A_ADDR]], align 8
42-
// O0-NEXT: store i64 [[I:%.*]], ptr [[I_ADDR]], align 8
39+
// O0-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 8
40+
// O0-NEXT: store i64 [[I]], ptr [[I_ADDR]], align 8
4341
// O0-NEXT: [[P:%.*]] = getelementptr inbounds nuw [[STRUCT_S]], ptr [[S]], i32 0, i32 0
4442
// O0-NEXT: [[TMP0:%.*]] = load ptr, ptr [[A_ADDR]], align 8
4543
// O0-NEXT: store ptr [[TMP0]], ptr [[P]], align 8
@@ -66,8 +64,8 @@ struct S {
6664
// O0-NEXT: store ptr [[WIDE_PTR_UB]], ptr [[TMP8]], align 8
6765
// O0-NEXT: [[TMP9:%.*]] = getelementptr inbounds nuw %"__bounds_safety::wide_ptr.bidi_indexable", ptr [[SP]], i32 0, i32 2
6866
// O0-NEXT: store ptr [[WIDE_PTR_LB]], ptr [[TMP9]], align 8
69-
// O0-NEXT: br label [[BINGO:%.*]]
70-
// O0: bingo:
67+
// O0-NEXT: br label %[[BINGO:.*]]
68+
// O0: [[BINGO]]:
7169
// O0-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 8 [[AGG_TEMP2]], ptr align 8 [[SP]], i64 24, i1 false)
7270
// O0-NEXT: [[WIDE_PTR_PTR_ADDR3:%.*]] = getelementptr inbounds nuw %"__bounds_safety::wide_ptr.bidi_indexable", ptr [[AGG_TEMP2]], i32 0, i32 0
7371
// O0-NEXT: [[WIDE_PTR_PTR4:%.*]] = load ptr, ptr [[WIDE_PTR_PTR_ADDR3]], align 8
@@ -76,18 +74,18 @@ struct S {
7674
// O0-NEXT: [[WIDE_PTR_LB_ADDR7:%.*]] = getelementptr inbounds nuw %"__bounds_safety::wide_ptr.bidi_indexable", ptr [[AGG_TEMP2]], i32 0, i32 2
7775
// O0-NEXT: [[WIDE_PTR_LB8:%.*]] = load ptr, ptr [[WIDE_PTR_LB_ADDR7]], align 8
7876
// O0-NEXT: [[TMP10:%.*]] = getelementptr [[STRUCT_S]], ptr [[WIDE_PTR_PTR4]], i64 1
79-
// O0-NEXT: [[TMP11:%.*]] = icmp ule ptr [[TMP10]], [[WIDE_PTR_UB6]], {{!annotation ![0-9]+}}
80-
// O0-NEXT: br i1 [[TMP11]], label [[CONT:%.*]], label [[TRAP:%.*]], {{!annotation ![0-9]+}}
81-
// O0: trap:
82-
// O0-NEXT: call void @llvm.ubsantrap(i8 25) #[[ATTR3:[0-9]+]], {{!annotation ![0-9]+}}
83-
// O0-NEXT: unreachable, {{!annotation ![0-9]+}}
84-
// O0: cont:
85-
// O0-NEXT: [[TMP12:%.*]] = icmp ule ptr [[WIDE_PTR_LB8]], [[WIDE_PTR_PTR4]], {{!annotation ![0-9]+}}
86-
// O0-NEXT: br i1 [[TMP12]], label [[CONT10:%.*]], label [[TRAP9:%.*]], {{!annotation ![0-9]+}}
87-
// O0: trap9:
88-
// O0-NEXT: call void @llvm.ubsantrap(i8 25) #[[ATTR3]], {{!annotation ![0-9]+}}
89-
// O0-NEXT: unreachable, {{!annotation ![0-9]+}}
90-
// O0: cont10:
77+
// O0-NEXT: [[TMP11:%.*]] = icmp ule ptr [[TMP10]], [[WIDE_PTR_UB6]], !annotation [[META2:![0-9]+]]
78+
// O0-NEXT: br i1 [[TMP11]], label %[[CONT:.*]], label %[[TRAP:.*]], !annotation [[META2]]
79+
// O0: [[TRAP]]:
80+
// O0-NEXT: call void @llvm.ubsantrap(i8 25) #[[ATTR3:[0-9]+]], !annotation [[META2]]
81+
// O0-NEXT: unreachable, !annotation [[META2]]
82+
// O0: [[CONT]]:
83+
// O0-NEXT: [[TMP12:%.*]] = icmp ule ptr [[WIDE_PTR_LB8]], [[WIDE_PTR_PTR4]], !annotation [[META3:![0-9]+]]
84+
// O0-NEXT: br i1 [[TMP12]], label %[[CONT10:.*]], label %[[TRAP9:.*]], !annotation [[META3]]
85+
// O0: [[TRAP9]]:
86+
// O0-NEXT: call void @llvm.ubsantrap(i8 25) #[[ATTR3]], !annotation [[META3]]
87+
// O0-NEXT: unreachable, !annotation [[META3]]
88+
// O0: [[CONT10]]:
9189
// O0-NEXT: [[I11:%.*]] = getelementptr inbounds nuw [[STRUCT_S]], ptr [[WIDE_PTR_PTR4]], i32 0, i32 1
9290
// O0-NEXT: store i64 3, ptr [[I11]], align 8
9391
// O0-NEXT: ret void
@@ -99,4 +97,9 @@ bingo:;
9997
sp->i = 3; // run-time trap : oob
10098
}
10199

102-
100+
// O2: [[META2]] = !{!"bounds-safety-check-ptr-lt-upper-bound"}
101+
// O2: [[META3]] = !{!"bounds-safety-check-ptr-lt-upper-bound", !"bounds-safety-check-ptr-ge-lower-bound"}
102+
//.
103+
// O0: [[META2]] = !{!"bounds-safety-check-ptr-lt-upper-bound"}
104+
// O0: [[META3]] = !{!"bounds-safety-check-ptr-ge-lower-bound"}
105+
//.

clang/test/BoundsSafety/CodeGen/runtime-checks/ptr-arith-predec-self.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@
6565
// CHECK-O2-NEXT: entry:
6666
// CHECK-O2-NEXT: [[A:%.*]] = alloca [1 x i32], align 4
6767
// CHECK-O2-NEXT: call void @llvm.lifetime.start.p0(i64 4, ptr nonnull [[A]]) #[[ATTR3:[0-9]+]]
68-
// CHECK-O2-NEXT: store i32 0, ptr [[A]], align 4
6968
// CHECK-O2-NEXT: [[UPPER:%.*]] = getelementptr inbounds nuw i8, ptr [[A]], i64 4
7069
// CHECK-O2-NEXT: [[BOUND_PTR_ARITH:%.*]] = getelementptr i8, ptr [[A]], i64 -4
7170
// CHECK-O2-NEXT: [[TMP0:%.*]] = icmp ult ptr [[BOUND_PTR_ARITH]], [[UPPER]], {{!annotation ![0-9]+}}

clang/test/BoundsSafety/CodeGen/wide-ptr-assign-O2.c

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ void wide_array_subscript_ok() {
1717

1818
// CHECK-LABEL: @wide_array_subscript_trap1(
1919
// CHECK-NEXT: entry:
20-
// CHECK-NEXT: tail call void @llvm.ubsantrap(i8 25) #[[ATTR6:[0-9]+]], {{!annotation ![0-9]+}}
20+
// CHECK-NEXT: tail call void @llvm.ubsantrap(i8 25) #[[ATTR5:[0-9]+]], {{!annotation ![0-9]+}}
2121
// CHECK-NEXT: unreachable, {{!annotation ![0-9]+}}
2222
//
2323
void wide_array_subscript_trap1() {
@@ -29,19 +29,18 @@ void wide_array_subscript_trap1() {
2929
// CHECK-LABEL: @wide_array_subscript_trap2(
3030
// CHECK-NEXT: entry:
3131
// CHECK-NEXT: [[ARR:%.*]] = alloca [5 x %"__bounds_safety::wide_ptr.indexable"], align 8
32-
// CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 80, ptr nonnull [[ARR]]) #[[ATTR7:[0-9]+]]
33-
// CHECK-NEXT: call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(80) [[ARR]], i8 0, i64 80, i1 false), {{!annotation ![0-9]+}}
32+
// CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 80, ptr nonnull [[ARR]]) #[[ATTR6:[0-9]+]]
3433
// CHECK-NEXT: [[UPPER:%.*]] = getelementptr inbounds nuw i8, ptr [[ARR]], i64 80
3534
// CHECK-NEXT: [[ARRAYIDX:%.*]] = getelementptr i8, ptr [[ARR]], i64 -16
3635
// CHECK-NEXT: [[TMP0:%.*]] = icmp ult ptr [[ARRAYIDX]], [[UPPER]], {{!annotation ![0-9]+}}
3736
// CHECK-NEXT: [[TMP1:%.*]] = icmp uge ptr [[ARRAYIDX]], [[ARR]], {{!annotation ![0-9]+}}
3837
// CHECK-NEXT: [[OR_COND:%.*]] = and i1 [[TMP0]], [[TMP1]], {{!annotation ![0-9]+}}
3938
// CHECK-NEXT: br i1 [[OR_COND]], label [[CONT1:%.*]], label [[TRAP:%.*]], {{!annotation ![0-9]+}}
4039
// CHECK: trap:
41-
// CHECK-NEXT: call void @llvm.ubsantrap(i8 25) #[[ATTR6]], {{!annotation ![0-9]+}}
40+
// CHECK-NEXT: call void @llvm.ubsantrap(i8 25) #[[ATTR5]], {{!annotation ![0-9]+}}
4241
// CHECK-NEXT: unreachable, {{!annotation ![0-9]+}}
4342
// CHECK: cont1:
44-
// CHECK-NEXT: call void @llvm.lifetime.end.p0(i64 80, ptr nonnull [[ARR]]) #[[ATTR7]]
43+
// CHECK-NEXT: call void @llvm.lifetime.end.p0(i64 80, ptr nonnull [[ARR]]) #[[ATTR6]]
4544
// CHECK-NEXT: ret void
4645
//
4746
void wide_array_subscript_trap2() {
@@ -72,7 +71,7 @@ void wide_array_subscript_read_ok2() {
7271

7372
// CHECK-LABEL: @wide_array_subscript_read_trap(
7473
// CHECK-NEXT: entry:
75-
// CHECK-NEXT: tail call void @llvm.ubsantrap(i8 25) #[[ATTR6]], {{!annotation ![0-9]+}}
74+
// CHECK-NEXT: tail call void @llvm.ubsantrap(i8 25) #[[ATTR5]], {{!annotation ![0-9]+}}
7675
// CHECK-NEXT: unreachable, {{!annotation ![0-9]+}}
7776
//
7877
void wide_array_subscript_read_trap() {
@@ -93,7 +92,7 @@ void wide_deref_ok() {
9392

9493
// CHECK-LABEL: @wide_deref_trap(
9594
// CHECK-NEXT: entry:
96-
// CHECK-NEXT: tail call void @llvm.ubsantrap(i8 25) #[[ATTR6]], {{!annotation ![0-9]+}}
95+
// CHECK-NEXT: tail call void @llvm.ubsantrap(i8 25) #[[ATTR5]], {{!annotation ![0-9]+}}
9796
// CHECK-NEXT: unreachable, {{!annotation ![0-9]+}}
9897
//
9998
void wide_deref_trap() {
@@ -118,17 +117,16 @@ void wide_member_assign_ok() {
118117
// CHECK-LABEL: @wide_member_assign_trap(
119118
// CHECK-NEXT: entry:
120119
// CHECK-NEXT: [[W:%.*]] = alloca [[STRUCT_WIDE_MEMBER_T:%.*]], align 8
121-
// CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 24, ptr nonnull [[W]]) #[[ATTR7]]
122-
// CHECK-NEXT: call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) [[W]], i8 0, i64 24, i1 false), {{!annotation ![0-9]+}}
120+
// CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 24, ptr nonnull [[W]]) #[[ATTR6]]
123121
// CHECK-NEXT: [[TMP0:%.*]] = getelementptr inbounds nuw i8, ptr [[W]], i64 24
124122
// CHECK-NEXT: [[TMP1:%.*]] = getelementptr i8, ptr [[W]], i64 48
125123
// CHECK-NEXT: [[DOTNOT:%.*]] = icmp ugt ptr [[TMP1]], [[TMP0]], {{!annotation ![0-9]+}}
126124
// CHECK-NEXT: br i1 [[DOTNOT]], label [[TRAP:%.*]], label [[CONT1:%.*]], {{!annotation ![0-9]+}}
127125
// CHECK: trap:
128-
// CHECK-NEXT: call void @llvm.ubsantrap(i8 25) #[[ATTR6]], {{!annotation ![0-9]+}}
126+
// CHECK-NEXT: call void @llvm.ubsantrap(i8 25) #[[ATTR5]], {{!annotation ![0-9]+}}
129127
// CHECK-NEXT: unreachable, {{!annotation ![0-9]+}}
130128
// CHECK: cont1:
131-
// CHECK-NEXT: call void @llvm.lifetime.end.p0(i64 24, ptr nonnull [[W]]) #[[ATTR7]]
129+
// CHECK-NEXT: call void @llvm.lifetime.end.p0(i64 24, ptr nonnull [[W]]) #[[ATTR6]]
132130
// CHECK-NEXT: ret void
133131
//
134132
void wide_member_assign_trap() {

0 commit comments

Comments
 (0)