Skip to content

Commit a4b966a

Browse files
committed
add provenance-related test
1 parent f2ae9e5 commit a4b966a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/tools/miri/tests/pass/provenance.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ fn main() {
1010
bytewise_ptr_methods();
1111
bytewise_custom_memcpy();
1212
bytewise_custom_memcpy_chunked();
13+
int_load_strip_provenance();
1314
}
1415

1516
/// Some basic smoke tests for provenance.
@@ -137,3 +138,9 @@ fn bytewise_custom_memcpy_chunked() {
137138
assert_eq!(*ptr, 42);
138139
}
139140
}
141+
142+
fn int_load_strip_provenance() {
143+
let ptrs = [&42];
144+
let ints: [usize; 1] = unsafe { mem::transmute(ptrs) };
145+
assert_eq!(ptrs[0] as *const _ as usize, ints[0]);
146+
}

0 commit comments

Comments
 (0)