Skip to content

Commit e38e0e7

Browse files
author
The Miri Cronjob Bot
committed
Merge ref '125ff8a788c5' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh. Upstream ref: 125ff8a788c5d6a66917f499abdc00051afe6886 Filtered ref: bcbe2eb This merge was created using https://github.com/rust-lang/josh-sync.
2 parents 4769b65 + bcbe2eb commit e38e0e7

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

tests/pass/prefetch.rs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#![feature(core_intrinsics)]
2+
3+
// Test that these intrinsics work. Their behavior should be a no-op.
4+
5+
fn main() {
6+
static X: [u8; 8] = [0; 8];
7+
8+
::std::intrinsics::prefetch_read_data::<_, 1>(::std::ptr::null::<u8>());
9+
::std::intrinsics::prefetch_read_data::<_, 2>(::std::ptr::dangling::<u8>());
10+
::std::intrinsics::prefetch_read_data::<_, 3>(X.as_ptr());
11+
12+
::std::intrinsics::prefetch_write_data::<_, 1>(::std::ptr::null::<u8>());
13+
::std::intrinsics::prefetch_write_data::<_, 2>(::std::ptr::dangling::<u8>());
14+
::std::intrinsics::prefetch_write_data::<_, 3>(X.as_ptr());
15+
16+
::std::intrinsics::prefetch_read_instruction::<_, 1>(::std::ptr::null::<u8>());
17+
::std::intrinsics::prefetch_read_instruction::<_, 2>(::std::ptr::dangling::<u8>());
18+
::std::intrinsics::prefetch_read_instruction::<_, 3>(X.as_ptr());
19+
20+
::std::intrinsics::prefetch_write_instruction::<_, 1>(::std::ptr::null::<u8>());
21+
::std::intrinsics::prefetch_write_instruction::<_, 2>(::std::ptr::dangling::<u8>());
22+
::std::intrinsics::prefetch_write_instruction::<_, 3>(X.as_ptr());
23+
}

0 commit comments

Comments
 (0)