forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathreturn-via-stack.rs
More file actions
41 lines (36 loc) · 1.17 KB
/
Copy pathreturn-via-stack.rs
File metadata and controls
41 lines (36 loc) · 1.17 KB
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
//@ build-fail
//@ compile-flags: --target thumbv8m.main-none-eabi --crate-type lib
//@ needs-llvm-components: arm
#![feature(abi_c_cmse_nonsecure_call, no_core, lang_items, intrinsics)]
#![no_core]
#[lang = "sized"]
pub trait Sized {}
#[lang = "copy"]
pub trait Copy {}
impl Copy for u32 {}
#[repr(C)]
pub struct ReprCU64(u64);
#[repr(C)]
pub struct ReprCBytes(u8, u8, u8, u8, u8);
#[repr(C)]
pub struct U64Compound(u32, u32);
#[repr(C, align(16))]
pub struct ReprCAlign16(u16);
#[no_mangle]
pub fn test(
f1: extern "C-cmse-nonsecure-call" fn() -> ReprCU64,
f2: extern "C-cmse-nonsecure-call" fn() -> ReprCBytes,
f3: extern "C-cmse-nonsecure-call" fn() -> U64Compound,
f4: extern "C-cmse-nonsecure-call" fn() -> ReprCAlign16,
f5: extern "C-cmse-nonsecure-call" fn() -> [u8; 5],
f6: extern "C-cmse-nonsecure-call" fn() -> u128, //~ WARNING [improper_ctypes_definitions]
f7: extern "C-cmse-nonsecure-call" fn() -> i128, //~ WARNING [improper_ctypes_definitions]
) {
f1(); //~ ERROR [E0798]
f2(); //~ ERROR [E0798]
f3(); //~ ERROR [E0798]
f4(); //~ ERROR [E0798]
f5(); //~ ERROR [E0798]
f6(); //~ ERROR [E0798]
f7(); //~ ERROR [E0798]
}