Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

rust: sync: atomic: Add store_release/load_acquire tests

Add minimum store_release/load_acquire tests.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
Reviewed-by: Gary Guo <gary@garyguo.net>
Reviewed-by: Joel Fernandes <joelagnelf@nvidia.com>
Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
Link: https://patch.msgid.link/20251211113826.1299077-5-fujita.tomonori@gmail.com

authored by

FUJITA Tomonori and committed by
Boqun Feng
7b001c97 b33796d5

+10
+10
rust/kernel/sync/atomic/predefine.rs
··· 138 138 } 139 139 140 140 #[test] 141 + fn atomic_acquire_release_tests() { 142 + for_each_type!(42 in [i8, i16, i32, i64, u32, u64, isize, usize] |v| { 143 + let x = Atomic::new(0); 144 + 145 + x.store(v, Release); 146 + assert_eq!(v, x.load(Acquire)); 147 + }); 148 + } 149 + 150 + #[test] 141 151 fn atomic_xchg_tests() { 142 152 for_each_type!(42 in [i32, i64, u32, u64, isize, usize] |v| { 143 153 let x = Atomic::new(v);