rust/tests/ui/asm/const-refs-to-static.rs
Ding Xiang Fei 1576a6d618
Stabilize const_refs_to_static
update tests

fix bitwidth-sensitive stderr output

use build-fail for asm tests
2024-09-26 13:21:15 +02:00

20 lines
363 B
Rust

//@ 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() {}