summaryrefslogtreecommitdiffstats
path: root/src/test/ui/asm/x86_64/type-check-4.rs
blob: 3d5d3807c530e7f7c1bb7b0e629bd0b51a9025c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// only-x86_64
// compile-flags: -C target-feature=+avx512f

#![feature(asm_const)]

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

use std::arch::x86_64::{_mm256_setzero_ps, _mm_setzero_ps};

fn main() {}

// Constants must be... constant

static S: i32 = 1;
const fn const_foo(x: i32) -> i32 {
    x
}
const fn const_bar<T>(x: T) -> T {
    x
}
global_asm!("{}", const S);
//~^ ERROR constants cannot refer to statics
global_asm!("{}", const const_foo(0));
global_asm!("{}", const const_foo(S));
//~^ ERROR constants cannot refer to statics
global_asm!("{}", const const_bar(0));
global_asm!("{}", const const_bar(S));
//~^ ERROR constants cannot refer to statics