summaryrefslogtreecommitdiffstats
path: root/tests/ui/feature-gates/feature-gate-abi-riscv-interrupt.rs
blob: 7755a46da3b5185ab73173674cdf037f52c63c57 (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
29
30
31
32
33
// needs-llvm-components: riscv
// compile-flags: --target=riscv32imc-unknown-none-elf --crate-type=rlib
#![no_core]
#![feature(no_core, lang_items)]
#[lang = "sized"]
trait Sized {}

// Test that the riscv interrupt ABIs cannot be used when riscv_interrupt
// feature gate is not used.

extern "riscv-interrupt-m" fn f() {}
//~^ ERROR riscv-interrupt ABIs are experimental
extern "riscv-interrupt-s" fn f_s() {}
//~^ ERROR riscv-interrupt ABIs are experimental

trait T {
    extern "riscv-interrupt-m" fn m();
    //~^ ERROR riscv-interrupt ABIs are experimental
}

struct S;
impl T for S {
    extern "riscv-interrupt-m" fn m() {}
    //~^ ERROR riscv-interrupt ABIs are experimental
}

impl S {
    extern "riscv-interrupt-m" fn im() {}
    //~^ ERROR riscv-interrupt ABIs are experimental
}

type TA = extern "riscv-interrupt-m" fn();
//~^ ERROR riscv-interrupt ABIs are experimental