@@ -80,7 +80,7 @@ pub fn option_nonzero_int(x: Option<NonZero<u64>>) -> Option<NonZero<u64>> {
80
80
x
81
81
}
82
82
83
- // CHECK: @readonly_borrow(ptr noalias noundef readonly align 4 dereferenceable(4) %_1)
83
+ // CHECK: @readonly_borrow(ptr noalias noundef readonly align 4{{( captures\(address, read_provenance\))}} dereferenceable(4) %_1)
84
84
// FIXME #25759 This should also have `nocapture`
85
85
#[ no_mangle]
86
86
pub fn readonly_borrow ( _: & i32 ) { }
@@ -91,12 +91,12 @@ pub fn readonly_borrow_ret() -> &'static i32 {
91
91
loop { }
92
92
}
93
93
94
- // CHECK: @static_borrow(ptr noalias noundef readonly align 4 dereferenceable(4) %_1)
94
+ // CHECK: @static_borrow(ptr noalias noundef readonly align 4{{( captures\(address, read_provenance\))}} dereferenceable(4) %_1)
95
95
// static borrow may be captured
96
96
#[ no_mangle]
97
97
pub fn static_borrow ( _: & ' static i32 ) { }
98
98
99
- // CHECK: @named_borrow(ptr noalias noundef readonly align 4 dereferenceable(4) %_1)
99
+ // CHECK: @named_borrow(ptr noalias noundef readonly align 4{{( captures\(address, read_provenance\))}} dereferenceable(4) %_1)
100
100
// borrow with named lifetime may be captured
101
101
#[ no_mangle]
102
102
pub fn named_borrow < ' r > ( _: & ' r i32 ) { }
@@ -129,21 +129,21 @@ pub fn mutable_borrow_ret() -> &'static mut i32 {
129
129
// <https://github.com/rust-lang/unsafe-code-guidelines/issues/381>.
130
130
pub fn mutable_notunpin_borrow ( _: & mut NotUnpin ) { }
131
131
132
- // CHECK: @notunpin_borrow(ptr noalias noundef readonly align 4 dereferenceable(4) %_1)
132
+ // CHECK: @notunpin_borrow(ptr noalias noundef readonly align 4{{( captures\(address, read_provenance\))}} dereferenceable(4) %_1)
133
133
// But `&NotUnpin` behaves perfectly normal.
134
134
#[ no_mangle]
135
135
pub fn notunpin_borrow ( _: & NotUnpin ) { }
136
136
137
- // CHECK: @indirect_struct(ptr noalias{{( nocapture)?}} noundef readonly align 4{{( captures\(none\))?}} dereferenceable(32) %_1)
137
+ // CHECK: @indirect_struct(ptr{{( dead_on_return)?}} noalias{{( nocapture)?}} noundef readonly align 4{{( captures\(none\))?}} dereferenceable(32) %_1)
138
138
#[ no_mangle]
139
139
pub fn indirect_struct ( _: S ) { }
140
140
141
- // CHECK: @borrowed_struct(ptr noalias noundef readonly align 4 dereferenceable(32) %_1)
141
+ // CHECK: @borrowed_struct(ptr noalias noundef readonly align 4{{( captures\(address, read_provenance\))}} dereferenceable(32) %_1)
142
142
// FIXME #25759 This should also have `nocapture`
143
143
#[ no_mangle]
144
144
pub fn borrowed_struct ( _: & S ) { }
145
145
146
- // CHECK: @option_borrow(ptr noalias noundef readonly align 4 dereferenceable_or_null(4) %_x)
146
+ // CHECK: @option_borrow(ptr noalias noundef readonly align 4{{( captures\(address, read_provenance\))}} dereferenceable_or_null(4) %_x)
147
147
#[ no_mangle]
148
148
pub fn option_borrow ( _x : Option < & i32 > ) { }
149
149
@@ -185,7 +185,7 @@ pub fn _box(x: Box<i32>) -> Box<i32> {
185
185
// With a custom allocator, it should *not* have `noalias`. (See
186
186
// <https://github.com/rust-lang/miri/issues/3341> for why.) The second argument is the allocator,
187
187
// which is a reference here that still carries `noalias` as usual.
188
- // CHECK: @_box_custom(ptr noundef nonnull align 4 %x.0, ptr noalias noundef nonnull readonly align 1 %x.1)
188
+ // CHECK: @_box_custom(ptr noundef nonnull align 4 %x.0, ptr noalias noundef nonnull readonly align 1{{( captures\(address, read_provenance\))}} %x.1)
189
189
#[ no_mangle]
190
190
pub fn _box_custom ( x : Box < i32 , & std:: alloc:: Global > ) {
191
191
drop ( x)
@@ -208,7 +208,7 @@ pub fn struct_return() -> S {
208
208
#[ no_mangle]
209
209
pub fn helper ( _: usize ) { }
210
210
211
- // CHECK: @slice(ptr noalias noundef nonnull readonly align 1 %_1.0, [[USIZE]] noundef %_1.1)
211
+ // CHECK: @slice(ptr noalias noundef nonnull readonly align 1{{( captures\(address, read_provenance\))}} %_1.0, [[USIZE]] noundef %_1.1)
212
212
// FIXME #25759 This should also have `nocapture`
213
213
#[ no_mangle]
214
214
pub fn slice ( _: & [ u8 ] ) { }
@@ -227,7 +227,7 @@ pub fn unsafe_slice(_: &[UnsafeInner]) {}
227
227
#[ no_mangle]
228
228
pub fn raw_slice ( _: * const [ u8 ] ) { }
229
229
230
- // CHECK: @str(ptr noalias noundef nonnull readonly align 1 %_1.0, [[USIZE]] noundef %_1.1)
230
+ // CHECK: @str(ptr noalias noundef nonnull readonly align 1{{( captures\(address, read_provenance\))}} %_1.0, [[USIZE]] noundef %_1.1)
231
231
// FIXME #25759 This should also have `nocapture`
232
232
#[ no_mangle]
233
233
pub fn str ( _: & [ u8 ] ) { }
@@ -259,7 +259,7 @@ pub fn trait_option(x: Option<Box<dyn Drop + Unpin>>) -> Option<Box<dyn Drop + U
259
259
x
260
260
}
261
261
262
- // CHECK: { ptr, [[USIZE]] } @return_slice(ptr noalias noundef nonnull readonly align 2 %x.0, [[USIZE]] noundef %x.1)
262
+ // CHECK: { ptr, [[USIZE]] } @return_slice(ptr noalias noundef nonnull readonly align 2{{( captures\(address, read_provenance\))}} %x.0, [[USIZE]] noundef %x.1)
263
263
#[ no_mangle]
264
264
pub fn return_slice ( x : & [ u16 ] ) -> & [ u16 ] {
265
265
x
0 commit comments