summaryrefslogtreecommitdiffstats
path: root/tests/ui/feature-gates/feature-gate-asm_const.rs
blob: 936918a3cfc864b542c94d3d59435a0bb9602726 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// only-x86_64

use std::arch::asm;

unsafe fn foo<const N: usize>() {
    asm!("mov eax, {}", const N + 1);
    //~^ ERROR const operands for inline assembly are unstable
}

fn main() {
    unsafe {
        foo::<0>();
        asm!("mov eax, {}", const 123);
        //~^ ERROR const operands for inline assembly are unstable
    }
}