]> git.lizzy.rs Git - rust.git/blob - src/test/ui/asm/x86_64/type-check-4.rs
Auto merge of #98471 - wesleywiser:update_measureme, r=Mark-Simulacrum
[rust.git] / src / test / ui / asm / x86_64 / type-check-4.rs
1 // only-x86_64
2 // compile-flags: -C target-feature=+avx512f
3
4 #![feature(asm_const, asm_sym)]
5
6 use std::arch::{asm, global_asm};
7
8 use std::arch::x86_64::{_mm256_setzero_ps, _mm_setzero_ps};
9
10 fn main() {
11 }
12
13 // Constants must be... constant
14
15 static S: i32 = 1;
16 const fn const_foo(x: i32) -> i32 {
17     x
18 }
19 const fn const_bar<T>(x: T) -> T {
20     x
21 }
22 global_asm!("{}", const S);
23 //~^ ERROR constants cannot refer to statics
24 global_asm!("{}", const const_foo(0));
25 global_asm!("{}", const const_foo(S));
26 //~^ ERROR constants cannot refer to statics
27 global_asm!("{}", const const_bar(0));
28 global_asm!("{}", const const_bar(S));
29 //~^ ERROR constants cannot refer to statics