Auto merge of #49811 - alexcrichton:fix-android, r=SimonSapin
std: Be sure to modify atomics in tests See #49775 for some more information but it looks like this is working around an LLVM bug for the time being. Closes #49775
This commit is contained in:
commit
880fbd7c4e
1 changed files with 6 additions and 4 deletions
|
@ -104,8 +104,10 @@ static S_UINT: AtomicUsize = AtomicUsize::new(0);
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn static_init() {
|
fn static_init() {
|
||||||
assert!(!S_FALSE.load(SeqCst));
|
// Note that we're not really testing the mutability here but it's important
|
||||||
assert!(S_TRUE.load(SeqCst));
|
// on Android at the moment (#49775)
|
||||||
assert!(S_INT.load(SeqCst) == 0);
|
assert!(!S_FALSE.swap(true, SeqCst));
|
||||||
assert!(S_UINT.load(SeqCst) == 0);
|
assert!(S_TRUE.swap(false, SeqCst));
|
||||||
|
assert!(S_INT.fetch_add(1, SeqCst) == 0);
|
||||||
|
assert!(S_UINT.fetch_add(1, SeqCst) == 0);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue