summaryrefslogtreecommitdiff
path: root/samples/test/inline_copy_values.rs
blob: 564234bfb89fd3b27b994bb32ccc59e38ad9a627 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// compile-flags: --test

#![feature(asm)]

#[test]
fn inlined_copy_args()
{
    #[inline(always)]
    fn inline_fn(mut v: u8) {
        v = 2;
        asm!("" : : "r" (v) : /*clobber*/ : "volatile");
    }
    let v = 1;
    inline_fn(v);
    assert_eq!(v, 1);
}