]> git.lizzy.rs Git - rust.git/blobdiff - src/test/run-pass-valgrind/cast-enum-with-dtor.rs
Add #[rustc_no_mir] to make tests pass with -Z orbit.
[rust.git] / src / test / run-pass-valgrind / cast-enum-with-dtor.rs
index 0bc1e33ce46956fa2d100ca62c5c4871a79b5bbd..0de949471c68407cf66129e7aaa16d494d473d6d 100644 (file)
@@ -8,7 +8,12 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-pretty : (#23623) problems when  ending with // comments
+
+// no-prefer-dynamic
+
 #![allow(dead_code)]
+#![feature(const_fn, rustc_attrs)]
 
 // check dtor calling order when casting enums.
 
@@ -22,7 +27,7 @@ enum E {
     C = 2
 }
 
-static FLAG: atomic::AtomicUsize = atomic::ATOMIC_USIZE_INIT;
+static FLAG: atomic::AtomicUsize = atomic::AtomicUsize::new(0);
 
 impl Drop for E {
     fn drop(&mut self) {
@@ -33,6 +38,7 @@ fn drop(&mut self) {
     }
 }
 
+#[rustc_no_mir] // FIXME #27840 MIR miscompiles this.
 fn main() {
     assert_eq!(FLAG.load(Ordering::SeqCst), 0);
     {