]> git.lizzy.rs Git - rust.git/blob - src/tools/miri/tests/pass-dep/page_size.rs
Rollup merge of #105796 - notriddle:notriddle/rustdoc-search-stop-doing-demerits...
[rust.git] / src / tools / miri / tests / pass-dep / page_size.rs
1 fn main() {
2     let page_size = page_size::get();
3
4     // In particular, this checks that it is not 0.
5     assert!(page_size.is_power_of_two(), "page size not a power of two: {}", page_size);
6     // Most architectures have 4k pages by default
7     #[cfg(not(any(
8         target_arch = "wasm32",
9         target_arch = "wasm64",
10         all(target_arch = "aarch64", target_vendor = "apple")
11     )))]
12     assert!(page_size == 4 * 1024, "non-4k default page size: {}", page_size);
13     // ... except aarch64-apple with 16k
14     #[cfg(all(target_arch = "aarch64", target_vendor = "apple"))]
15     assert!(page_size == 16 * 1024, "aarch64 apple reports non-16k page size: {}", page_size);
16     // ... and wasm with 64k
17     #[cfg(any(target_arch = "wasm32", target_arch = "wasm64"))]
18     assert!(page_size == 64 * 1024, "wasm reports non-64k page size: {}", page_size);
19 }