summary refs log tree commit diff
path: root/tests/ui/asm/const-refs-to-static.rs
blob: ce2c5b3246ec840eb677299d0ade022415dcfabe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
//@ needs-asm-support
//@ ignore-nvptx64
//@ ignore-spirv

use std::arch::{asm, global_asm};
use std::ptr::addr_of;

static FOO: u8 = 42;

global_asm!("{}", const addr_of!(FOO));
//~^ ERROR invalid type for `const` operand

#[no_mangle]
fn inline() {
    unsafe { asm!("{}", const addr_of!(FOO)) };
    //~^ ERROR invalid type for `const` operand
}

fn main() {}