diff options
| author | bors <bors@rust-lang.org> | 2015-03-23 00:37:35 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-03-23 00:37:35 +0000 |
| commit | 809a554fca2d0ebc2ba50077016fe282a4064752 (patch) | |
| tree | eb7494e5b785d5abb724393c4ade43ed572f9c89 /src/test/run-pass | |
| parent | b0aad7dd4fad8d7e2e2f877a511a637258949597 (diff) | |
| parent | b4e9106a8a476c2b77e2c4cd8717a9bc1b95de52 (diff) | |
| download | rust-809a554fca2d0ebc2ba50077016fe282a4064752.tar.gz rust-809a554fca2d0ebc2ba50077016fe282a4064752.zip | |
Auto merge of #23593 - Manishearth:rollup, r=Manishearth
(yay, no Saturday)
Diffstat (limited to 'src/test/run-pass')
| -rw-r--r-- | src/test/run-pass/issue-23550.rs | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/test/run-pass/issue-23550.rs b/src/test/run-pass/issue-23550.rs new file mode 100644 index 00000000000..97357c1dba4 --- /dev/null +++ b/src/test/run-pass/issue-23550.rs @@ -0,0 +1,39 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or +// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license +// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(core)] +#![allow(warnings)] + +use std::intrinsics; + +#[derive(Copy)] +struct Wrap(i64); + +// These volatile and atomic intrinsics used to cause an ICE + +unsafe fn test_bool(p: &mut bool, v: bool) { + intrinsics::volatile_load(p); + intrinsics::volatile_store(p, v); + intrinsics::atomic_load(p); + intrinsics::atomic_cxchg(p, v, v); + intrinsics::atomic_store(p, v); + intrinsics::atomic_xchg(p, v); +} + +unsafe fn test_immediate_fca(p: &mut Wrap, v: Wrap) { + intrinsics::volatile_load(p); + intrinsics::volatile_store(p, v); + intrinsics::atomic_load(p); + intrinsics::atomic_cxchg(p, v, v); + intrinsics::atomic_store(p, v); + intrinsics::atomic_xchg(p, v); +} + +fn main() {} |
