]> git.proxmox.com Git - rustc.git/blob - tests/ui/asm/aarch64/type-check-4.rs
New upstream version 1.68.2+dfsg1
[rustc.git] / tests / ui / asm / aarch64 / type-check-4.rs
1 // only-aarch64
2 // compile-flags: -C target-feature=+neon
3
4 #![feature(repr_simd, stdsimd, asm_const)]
5
6 use std::arch::aarch64::float64x2_t;
7 use std::arch::{asm, global_asm};
8
9 #[repr(simd)]
10 #[derive(Copy, Clone)]
11 struct Simd256bit(f64, f64, f64, f64);
12
13 fn main() {
14 }
15
16 // Constants must be... constant
17
18 static S: i32 = 1;
19 const fn const_foo(x: i32) -> i32 {
20 x
21 }
22 const fn const_bar<T>(x: T) -> T {
23 x
24 }
25 global_asm!("{}", const S);
26 //~^ ERROR constants cannot refer to statics
27 global_asm!("{}", const const_foo(0));
28 global_asm!("{}", const const_foo(S));
29 //~^ ERROR constants cannot refer to statics
30 global_asm!("{}", const const_bar(0));
31 global_asm!("{}", const const_bar(S));
32 //~^ ERROR constants cannot refer to statics