Skip to content

Commit 9ead6d5

Browse files
author
The Miri Cronjob Bot
committed
Merge ref 'f4665ab8368a' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh. Upstream ref: f4665ab8368ad2e8a86d4390ae35c28bdd9561bb Filtered ref: d2e3c00 Upstream diff: rust-lang/rust@a09fbe2...f4665ab This merge was created using https://github.com/rust-lang/josh-sync.
2 parents 06fc220 + d2e3c00 commit 9ead6d5

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tests/pass/static_align.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#![feature(static_align)]
2+
3+
// When a static uses `align(N)`, its address should be a multiple of `N`.
4+
5+
#[rustc_align_static(256)]
6+
static FOO: u64 = 0;
7+
8+
#[rustc_align_static(512)]
9+
static BAR: u64 = 0;
10+
11+
fn main() {
12+
assert!(core::ptr::from_ref(&FOO).addr().is_multiple_of(256));
13+
assert!(core::ptr::from_ref(&BAR).addr().is_multiple_of(512));
14+
}

0 commit comments

Comments
 (0)