about summary refs log tree commit diff
path: root/tests/ui/abi/unsupported.rs
blob: 828fcc147a560caaa68a342ce1a8caa759ee762f (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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
//@ add-core-stubs
//@ revisions: x64 x64_win i686 aarch64 arm riscv32 riscv64
//
//@ [x64] needs-llvm-components: x86
//@ [x64] compile-flags: --target=x86_64-unknown-linux-gnu --crate-type=rlib
//@ [x64_win] needs-llvm-components: x86
//@ [x64_win] compile-flags: --target=x86_64-pc-windows-msvc --crate-type=rlib
//@ [i686] needs-llvm-components: x86
//@ [i686] compile-flags: --target=i686-unknown-linux-gnu --crate-type=rlib
//@ [aarch64] needs-llvm-components: aarch64
//@ [aarch64] compile-flags: --target=aarch64-unknown-linux-gnu --crate-type=rlib
//@ [arm] needs-llvm-components: arm
//@ [arm] compile-flags: --target=armv7-unknown-linux-gnueabihf --crate-type=rlib
//@ [riscv32] needs-llvm-components: riscv
//@ [riscv32] compile-flags: --target=riscv32i-unknown-none-elf --crate-type=rlib
//@ [riscv64] needs-llvm-components: riscv
//@ [riscv64] compile-flags: --target=riscv64gc-unknown-none-elf --crate-type=rlib
#![no_core]
#![feature(
    no_core,
    lang_items,
    abi_ptx,
    abi_msp430_interrupt,
    abi_avr_interrupt,
    abi_gpu_kernel,
    abi_x86_interrupt,
    abi_riscv_interrupt,
    abi_cmse_nonsecure_call,
    abi_vectorcall,
    cmse_nonsecure_entry
)]

extern crate minicore;
use minicore::*;

extern "ptx-kernel" fn ptx() {}
//~^ ERROR is not a supported ABI
fn ptx_ptr(f: extern "ptx-kernel" fn()) {
//~^ ERROR is not a supported ABI
    f()
}
extern "ptx-kernel" {}
//~^ ERROR is not a supported ABI
extern "gpu-kernel" fn gpu() {}
//~^ ERROR is not a supported ABI

extern "aapcs" fn aapcs() {}
//[x64,x64_win,i686,aarch64,riscv32,riscv64]~^ ERROR is not a supported ABI
fn aapcs_ptr(f: extern "aapcs" fn()) {
    //[x64,x64_win,i686,aarch64,riscv32,riscv64]~^ ERROR is not a supported ABI
    f()
}
extern "aapcs" {}
//[x64,x64_win,i686,aarch64,riscv32,riscv64]~^ ERROR is not a supported ABI

extern "msp430-interrupt" {}
//~^ ERROR is not a supported ABI

extern "avr-interrupt" {}
//~^ ERROR is not a supported ABI

extern "riscv-interrupt-m" {}
//[x64,x64_win,i686,arm,aarch64]~^ ERROR is not a supported ABI

extern "x86-interrupt" {}
//[aarch64,arm,riscv32,riscv64]~^ ERROR is not a supported ABI

extern "thiscall" fn thiscall() {}
//[x64,x64_win,arm,aarch64,riscv32,riscv64]~^ ERROR is not a supported ABI
fn thiscall_ptr(f: extern "thiscall" fn()) {
    //[x64,x64_win,arm,aarch64,riscv32,riscv64]~^ ERROR is not a supported ABI
    f()
}
extern "thiscall" {}
//[x64,x64_win,arm,aarch64,riscv32,riscv64]~^ ERROR is not a supported ABI

extern "stdcall" fn stdcall() {}
//[x64,arm,aarch64,riscv32,riscv64]~^ ERROR is not a supported ABI
//[x64_win]~^^ WARN unsupported_calling_conventions
//[x64_win]~^^^ WARN this was previously accepted
fn stdcall_ptr(f: extern "stdcall" fn()) {
    //[x64,arm,aarch64,riscv32,riscv64]~^ ERROR is not a supported ABI
    //[x64_win]~^^ WARN unsupported_calling_conventions
    //[x64_win]~|  WARN this was previously accepted
    f()
}
extern "stdcall" {}
//[x64,arm,aarch64,riscv32,riscv64]~^ ERROR is not a supported ABI
//[x64_win]~^^ WARN unsupported_calling_conventions
//[x64_win]~^^^ WARN this was previously accepted
extern "stdcall-unwind" {}
//[x64,arm,aarch64,riscv32,riscv64]~^ ERROR is not a supported ABI
//[x64_win]~^^ WARN unsupported_calling_conventions
//[x64_win]~^^^ WARN this was previously accepted

extern "cdecl" fn cdecl() {}
//[x64,x64_win,arm,aarch64,riscv32,riscv64]~^ WARN unsupported_calling_conventions
//[x64,x64_win,arm,aarch64,riscv32,riscv64]~^^ WARN this was previously accepted
fn cdecl_ptr(f: extern "cdecl" fn()) {
    //[x64,x64_win,arm,aarch64,riscv32,riscv64]~^ WARN unsupported_calling_conventions
    //[x64,x64_win,arm,aarch64,riscv32,riscv64]~| WARN this was previously accepted
    f()
}
extern "cdecl" {}
//[x64,x64_win,arm,aarch64,riscv32,riscv64]~^ WARN unsupported_calling_conventions
//[x64,x64_win,arm,aarch64,riscv32,riscv64]~^^ WARN this was previously accepted
extern "cdecl-unwind" {}
//[x64,x64_win,arm,aarch64,riscv32,riscv64]~^ WARN unsupported_calling_conventions
//[x64,x64_win,arm,aarch64,riscv32,riscv64]~^^ WARN this was previously accepted

extern "vectorcall" fn vectorcall() {}
//[arm,aarch64,riscv32,riscv64]~^ ERROR is not a supported ABI
fn vectorcall_ptr(f: extern "vectorcall" fn()) {
    //[arm,aarch64,riscv32,riscv64]~^ ERROR is not a supported ABI
    f()
}
extern "vectorcall" {}
//[arm,aarch64,riscv32,riscv64]~^ ERROR is not a supported ABI

fn cmse_call_ptr(f: extern "cmse-nonsecure-call" fn()) {
//~^ ERROR is not a supported ABI
    f()
}

extern "cmse-nonsecure-entry" fn cmse_entry() {}
//~^ ERROR is not a supported ABI
fn cmse_entry_ptr(f: extern "cmse-nonsecure-entry" fn()) {
//~^ ERROR is not a supported ABI
    f()
}
extern "cmse-nonsecure-entry" {}
//~^ ERROR is not a supported ABI

#[cfg(windows)]
#[link(name = "foo", kind = "raw-dylib")]
extern "cdecl" {}
//[x64_win]~^ WARN unsupported_calling_conventions
//[x64_win]~^^ WARN this was previously accepted