3 // aux-build:issue-17718-aux.rs
5 extern crate issue_17718_aux as other;
7 use std::sync::atomic::{AtomicUsize, Ordering};
10 const C2: AtomicUsize = AtomicUsize::new(0);
12 const C4: usize = C1 * C1 + C1 / C1;
13 const C5: &'static usize = &C4;
20 static S2: AtomicUsize = AtomicUsize::new(0);
24 static B: &'static usize = &A;
25 static C: &'static usize = &(A);
33 assert_eq!(C2.fetch_add(1, Ordering::SeqCst), 0);
34 assert_eq!(C2.fetch_add(1, Ordering::SeqCst), 0);
39 assert_eq!(S2.fetch_add(1, Ordering::SeqCst), 0);
40 assert_eq!(S2.fetch_add(1, Ordering::SeqCst), 1);
55 assert_eq!(other::C1, 1);
56 assert_eq!(other::C3(), ());
57 assert_eq!(other::C2.fetch_add(1, Ordering::SeqCst), 0);
58 assert_eq!(other::C2.fetch_add(1, Ordering::SeqCst), 0);
59 assert_eq!(other::C4, 2);
60 assert_eq!(*other::C5, 2);
61 assert_eq!(other::S1, 3);
62 assert_eq!(other::S2.fetch_add(1, Ordering::SeqCst), 0);
63 assert_eq!(other::S2.fetch_add(1, Ordering::SeqCst), 1);